Re: Upgrade to dual processor machine? - Mailing list pgsql-general

From Josh Berkus
Subject Re: Upgrade to dual processor machine?
Date
Msg-id 200211121205.44452.josh@agliodbs.com
Whole thread Raw
In response to Upgrade to dual processor machine?  ("Henrik Steffen" <steffen@city-map.de>)
Responses Re: Upgrade to dual processor machine?  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
Heinrik,

"So, where do i find and change shmmax shmall settings ??
What should I put there?

What is a recommended value for shared buffers in postgresql.conf ?"

There is no "recommended value."   You have to calculate this relatively:

1) Figure out how much RAM your server has available for PostgreSQL.  For
example, I have one server on which I allocate 256 mb for Apache, 128 mb for
linux, and thus have 512mb available for Postgres.

2) Calculate out the memory settings to use 70% of that amount of Ram in
regular usage.   Please beware that sort_mem is *not* shared, meaning that it
will be multiplied by the number of concurrent requests requiring sorting.
Thus, your calculation (in K) should be:

250K  +
8.2K * shared_buffers +
14.2K * max_connections +
sort_mem * average number of requests per minute
=====================================
memory available to postgresql in K * 0.7

You will also have to set SHMMAX and SHMMALL to accept this memory allocation.
Since shmmax is set in bytes, then I generally feel safe making it:
1024 * 0.5 * memory available to postgresql in K

Setting them is done simply:
$ echo 134217728 >/proc/sys/kernel/shmall
$ echo 134217728 >/proc/sys/kernel/shmmax

This is all taken from the postgresql documentation, with some experience:
http://www.us.postgresql.org/users-lounge/docs/7.2/postgres/runtime.html

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-general by date:

Previous
From: "Henrik Steffen"
Date:
Subject: Re: Upgrade to dual processor machine?
Next
From: Robert Treat
Date:
Subject: Re: Max connections