Re: Setting kernel.shmmax - Mailing list pgsql-admin

From Mike Ivanov
Subject Re: Setting kernel.shmmax
Date
Msg-id 4A57B302.9050600@activestate.com
Whole thread Raw
In response to Re: Setting kernel.shmmax  (fatih ozturk <ozturkfa@yahoo.com>)
List pgsql-admin
fatih ozturk wrote:

 > In most of tuning guides setting shmmax
 > parameter to %90 of total memory is advised.

Does not seem a good idea to me.

 > is kernel.shmmax is about max connection to a database.
 > So shmmax does not effects memory usage of querys directly.

No.

OK, there are two parameters. One is called shared_buffers in
posrgesql.conf. This parameter defines the size of a memory block used
by Postgres for buffers, cache and such. This memory region is called
Shared Memory (well, because it is shared between Postgres processes).

The operating system puts certain limits on how big those shared memory
regions could be. The maximum size is defined by kernel.shmmax parameter.

First you decide on how much memory Postgres should use. How much
exactly--it depends. In most cases it is safe to give 1/4 to 1/2 of all
the memory to Postgres, provided there are no other services (like
Apache) running on that machine. In your particular case I'd stick
closer to 1/4 side. Put that value in postgresql.conf.

Now, make kernel.shmmax slightly bigger than shared_buffers to
accommodate that value.

Cheers,
Mike



pgsql-admin by date:

Previous
From: Anj Adu
Date:
Subject: Re: Setting Shared-Buffers
Next
From: Scott Marlowe
Date:
Subject: Re: Setting Shared-Buffers