Re: Help Required - Mailing list pgsql-cygwin

From Jason Tishler
Subject Re: Help Required
Date
Msg-id 20030813150937.GI1108@tishler.net
Whole thread Raw
In response to Re: Help Required  ("Kamalraj Singh Madhan" <kamalr@networkprograms.com>)
List pgsql-cygwin
Kamalraj,

On Wed, Aug 13, 2003 at 06:12:39PM +0530, Kamalraj Singh Madhan wrote:
> Could you please elaborate as in how do we alter the fork limit of
> cygwin and what exactly will happen after we have increased the value.

Unfortunately, it is not that simple...

Cygwin's fork() implementation has a hard limit of 63 children due to
its dependency on MsgWaitForMultipleObjects() which has its own
limitations:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/msgwaitformultipleobjects.asp

Specifically, the following:

    nCount
        [in] Number of object handles in the array pointed to by
        pHandles. The maximum number of object handles is
        MAXIMUM_WAIT_OBJECTS minus one.

Additionally, we have the following:

    $ fgrep MAXIMUM_WAIT_OBJECTS /usr/include/w32api/winbase.h
    #define MAXIMUM_WAIT_OBJECTS 64

The above is why the magic number is 63.

Hence, to "alter the fork limit of cygwin" would require changing its
implementation.  This is not a trivial area of Cygwin to hack, but you
can always submit a patch.

> The number of connections specified in our postgresql.conf is 240 and
> shared buffers as 480, by making it ~60 what will we be achieving ?

Preventing your system from hitting the Cygwin fork() limit -- albeit,
with the obvious performance impact and/or connection refused errors...

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

pgsql-cygwin by date:

Previous
From: "Kamalraj Singh Madhan"
Date:
Subject: Re: Help Required
Next
From: "sharesun"
Date:
Subject: IpcSemaphoreCreate Error,help pls