Re: Setting kernel.shmmax

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

 



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



--
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux