Re: MacOS X Shared Buffers (SHMMAX)?

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Command Prompt, Inc(dot)" <pgsql-general(at)commandprompt(dot)com>, Steve Lane <slane(at)fmpro(dot)com>, jlx(at)commandprompt(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: MacOS X Shared Buffers (SHMMAX)?
Date: 2002-05-23 14:09:53
Message-ID: Pine.LNX.4.21.0205231506380.12663-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Wed, 22 May 2002, Tom Lane wrote:

> "Command Prompt, Inc." <pgsql-general(at)commandprompt(dot)com> writes:
> > I was able to pull down the source for the Kernel, and increased the
> > SHMMAX by a factor of 16. Upgraded to the new Kernel and I am now able to
> > get safely 512 connections, even up around 900, but bumping it up to 1024,
> > I run into the following error:
>
> > PGSTATBUFF: recvfrom(2): Resource temporarily unavailable
> > DEBUG: statistics collector process (pid 1988) exited with exit code 1
>
> > ...which then repeats itself infinitely until the calling process is
> > stopped. ;)
>
> [ scratches head... ] "Resource temporarily unavailable" is EAGAIN
> according to /usr/include/sys/errno.h on my OSX machine. But the man
> page for recvfrom doesn't mention any plausible reasons for EAGAIN to
> be signaled. select() just told us there was data available on the
> socket, so WTF? Could this be a kernel bug?
>
> You could try modifying pgstat.c to continue its loop rather than
> exiting after it gets a recvfrom error. But if the error condition
> recurs that'll just put pgstat.c into an infinite loop, so I'm not
> sure this is any solution --- just a way of gathering more data.

My 'standard' way of doing this is to loop while the error is EAGAIN but with a
small retry counter to limit the number of attempts made. Hopefully the second
time through the call isn't interrupted again. Therefore I'm usually quite
happy saying that after something like 5 calls to a routine then there really
is an error.

Isn't this how people normally handle this?

--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-05-23 14:09:55 Re: multiple version running
Previous Message Tom Lane 2002-05-23 13:59:59 Re: Violation of NOT NULL

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-05-23 14:49:13 Re: MacOS X Shared Buffers (SHMMAX)?
Previous Message Rajesh Kumar Mallah. 2002-05-23 13:44:27 Re: Functions with dynamic queries