Re: Help Required

From: Jason Tishler <jason(at)tishler(dot)net>
To: Kamalraj Singh Madhan <kamalr(at)networkprograms(dot)com>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: Help Required
Date: 2003-08-13 15:09:38
Message-ID: 20030813150937.GI1108@tishler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-cygwin by date

  From Date Subject
Next Message Claudia Beleites 2003-08-13 15:23:50 help installing postgres with cygwin - initdb: IpcSemaphoreCreate fails
Previous Message Kamalraj Singh Madhan 2003-08-13 12:42:39 Re: Help Required