Re: Upgrade to dual processor machine?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: steffen(at)city-map(dot)de
Subject: Re: Upgrade to dual processor machine?
Date: 2002-11-12 20:05:44
Message-ID: 200211121205.44452.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2002-11-12 20:11:33 Re: how do i insert a default value?
Previous Message Henrik Steffen 2002-11-12 19:45:12 Re: Upgrade to dual processor machine?

Browse pgsql-performance by date

  From Date Subject
Next Message scott.marlowe 2002-11-12 20:26:34 Re: Upgrade to dual processor machine?
Previous Message Henrik Steffen 2002-11-12 19:45:12 Re: Upgrade to dual processor machine?