EPYC 144 core machine has issues with Cygwin PID wraparound

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Sat Dec 21 06:24:33 GMT 2024


On 2024-12-20 04:58, Cedric Blancher via Cygwin wrote:
> On Fri, 20 Dec 2024 at 01:31, Brian Inglis via Cygwin <cygwin@cygwin.com> wrote:
>>
>> On 2024-12-19 16:42, Corinna Vinschen via Cygwin wrote:
>>> On Dec 19 17:20, Cedric Blancher via Cygwin wrote:
>>>> Good afternoon!
>>>>
>>>> We have a new AMD EPYC machine with 144 cores (upgraded from 8 core
>>>> machine) running Windows 10 Enterprise, with a mixture of native Win32
>>>> apps+Cygwin.
>>>> But the Cygwin apps cause trouble, as PID numbers get re-used too
>>>> fast. We churn through ~~6912000 child processes EVERY HOUR, which now
>>>> causes major problems with PID wraparounds in scripts and perl.
>>>>
>>>> 1. How can I increase the value at which pid-wraparound will happen?
>>>> 2. How can I test for Cygwins max PID value? Cygwin does not have
>>>> /proc/sys/kernel/pid_max
>>>
>>> We can't make the pid algorithm variable in terms of the max pid, so
>>> I changed the maximum PID to the maximum pid on Linux, i.e., 4194304.
>>>
>>> Please check out the next test release cygwin 3.6.0-0.294.g363357c023ce.
>>
>> Run the attached to check your upgrade:
>>
>> $ gcc -o cyg_max_pid{,.c} && ./cyg_max_pid
>> max pid 65536

> Can we please get an interface in /proc OR /bin/getconf to get/probe
> the maximum pid value?

Rename the program to sysctl and have it respond to arg kernel.pid_max with
kernel.pid_max = 4194304? ;^>

There appears to be no POSIX definition usable by getconf: why it is enabled by 
a CW_... value accessible via cygwin_internal().

Linux makes it available only under /proc/sys/kernel/pid_max tunables which 
Cygwin does not support as /proc/sys is for Windows objects.

BSDs including MacOSX seem to hard code 99999 now (was 30000).

Patches Gratefully Accepted!

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin mailing list