Search Postgresql Archives

Re: FreeBSD 5.2.1, postgresql 7.4.5 and shared memory settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 30 Jan 2005 20:50:21 +0000, Richard Poole <rp@xxxxxxxxxxxxxxx> wrote:
> On Sun, Jan 30, 2005 at 03:21:25PM -0500, Rick Apichairuk wrote:
> 
> > I am trying to increase the number of max_connections to 200 and found
> > out I couldn't even start postgresql. So I tried to increase
> > max_connections gradually (currently at 50 from 40 default) and adjust
> > shared memory settings along the way. Even at 50 max_connections, I
> > still cannot get postgresql to start.
> >
> > The following is the error message I receive:
> >
> > pgsql FATAL:  could not create shared memory segment: Invalid argument
> > DETAIL:  Failed system call was shmget(key=5432001, size=35323904,
> > 03600).
> 
> > To reduce the request size (currently 35323904 bytes),
> 
> > kern.ipc.shmmax: 33554432
> 
> Looks like the request size is just higher than shmmax. The majority of
> the request is for the shared buffers, so if you can't increase shmmax
> any more you can reduce your shared buffers downwards from 4096 and this
> will give you some room for more connections.
> 
> 
> Richard
> 

Thanks... I missed that completely (need sleep!). I will try to bump
up my SHMMAXPGS from 262144 to 400000.

Is the shared_buffers per process? The reason I ask is the formula
given on http://www.postgresql.org/docs/7.4/static/kernel-resources.html
for calculating how much SHMMAX you need is:

SHMMAX = 250 kB + 8.2 kB * shared_buffers + 14.2 kB * max_connections
up to infinity

If it were per process (connection) shouldn't it be:

SHMMAX = (250 kB + 8.2 kB * shared_buffers + 14.2 kB) *
max_connections up to infinity

Also the examples for FreeBSD are:

options         SYSVSHM
options         SHMMAXPGS=4096
options         SHMSEG=256

options         SYSVSEM
options         SEMMNI=256
options         SEMMNS=512
options         SEMMNU=256
options         SEMMAP=256

How many connections is this supposed to support?

Thanks in advance.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux