Re: Upgrade to dual processor machine?

From: "Henrik Steffen" <steffen(at)city-map(dot)de>
To: <josh(at)agliodbs(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Upgrade to dual processor machine?
Date: 2002-11-13 07:29:25
Message-ID: 008f01c28ae6$64a45e40$7100a8c0@STEINKAMP
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

Hello Josh!

This is was I figured out now:

1) RAM available: 1024 MB, there's nothing else but postgres on this
machine, so if I calculate 128 MB for Linux, there are 896 MB left
for Postgres.

2) 70 % of 896 MB is 627 MB

Now, if I follow your instructions:

250K +
8.2K * 128 (shared_buffers) = 1049,6K +
14.2K * 64 (max_connections) = 908,8K +
1024K * 5000 (average number of requests per minute) = 5120000K
===============================================================
5122208.4K ==> 5002.16 MB

this is a little bit more than I have available, isn't it? :(((

sure that this has got to be the "average number of requests per minute"
and not "per second" ? seems so much, doesn't it?

what am I supposed to do now?

thanks again,

--

Mit freundlichem Gruß

Henrik Steffen
Geschäftsführer

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
--------------------------------------------------------
http://www.topconcepts.com Tel. +49 4141 991230
mail: steffen(at)topconcepts(dot)com Fax. +49 4141 991233
--------------------------------------------------------
24h-Support Hotline: +49 1908 34697 (EUR 1.86/Min,topc)
--------------------------------------------------------
Ihr SMS-Gateway: JETZT NEU unter: http://sms.city-map.de
System-Partner gesucht: http://www.franchise.city-map.de
--------------------------------------------------------
Handelsregister: AG Stade HRB 5811 - UstId: DE 213645563
--------------------------------------------------------

----- Original Message -----
From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Cc: <steffen(at)city-map(dot)de>
Sent: Tuesday, November 12, 2002 9:05 PM
Subject: Re: Upgrade to dual processor machine?

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar 2002-11-13 07:53:36 Re: Upgrade to dual processor machine?
Previous Message Shridhar Daithankar 2002-11-13 07:02:20 Re: C++: get value for integral types?

Browse pgsql-performance by date

  From Date Subject
Next Message Shridhar Daithankar 2002-11-13 07:53:36 Re: Upgrade to dual processor machine?
Previous Message Neil Conway 2002-11-13 03:37:35 Re: Upgrade to dual processor machine?