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

From Henrik Steffen
Subject Re: Upgrade to dual processor machine?
Date
Msg-id 008f01c28ae6$64a45e40$7100a8c0@STEINKAMP
Whole thread Raw
In response to Re: Upgrade to dual processor machine?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Upgrade to dual processor machine?  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Re: Upgrade to dual processor machine?  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-general
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@topconcepts.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@agliodbs.com>
To: <pgsql-general@postgresql.org>
Cc: <steffen@city-map.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



pgsql-general by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: C++: get value for integral types?
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: Upgrade to dual processor machine?