Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: shared_buff...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 14 Topic 3991 of 4345
Post > Topic >>

Re: shared_buffers performance

by gsmith@[EMAIL PROTECTED] (Greg Smith) Apr 14, 2008 at 04:08 PM

On Mon, 14 Apr 2008, Tom Lane wrote:

> Ideally, very hot pages would stay in shared buffers and drop out of the
> kernel cache, allowing you to use a database approximating all-of-RAM
> before you hit the performance wall.

With "pgbench -S", the main hot pages that get elevated usage counts and 
cling persistantly to shared buffers are those holding data from the 
primary key on the accounts table.

Here's an example of what the buffer cache actually has after running 
"pgbench -S -c 8 -t 10000 pgbench" on a system with shared_buffers=256MB 
and a total of 2GB of RAM.  Database scale is 100, so there's 
approximately 1.5GB worth of database, mainly a 1.3GB accounts table and 
171MB of primary key on accounts:

relname       |buffered| buffers % | % of rel
accounts      | 306 MB | 65.3      | 24.7
accounts pkey | 160 MB | 34.1      | 93.2

relname       | buffers | usage
accounts      | 10223   | 0
accounts      | 25910   | 1
accounts      | 2825    | 2
accounts      | 214     | 3
accounts      | 14      | 4
accounts pkey | 2173    | 0
accounts pkey | 5392    | 1
accounts pkey | 5086    | 2
accounts pkey | 3747    | 3
accounts pkey | 2296    | 4
accounts pkey | 1756    | 5

This example and the queries to produce that summary are all from the 
"Inside the PostgreSQL Buffer Cache" talk on my web page.

For this simple workload, if you can fit the main primary key in shared 
buffers that helps, but making that too large takes away memory that could

be more usefully given to the OS to manage.  The fact that you can start 
to suffer from double-buffering (where the data is in the OS filesystem 
cache and shared_buffers) when making shared_buffers too large on a 
benchmark workload is interesting.  But I'd suggest considering the real 
application, rather than drawing a conclusion about shared_buffers sizing 
based just on that phenomenon.

--
* Greg Smith gsmith@[EMAIL PROTECTED]
 http://www.gregsmith.com
Baltimore, MD

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 14 Posts in Topic:
shared_buffers performance
mendola@[EMAIL PROTECTED]  2008-04-14 11:13:05 
Re: shared_buffers performance
stark@[EMAIL PROTECTED]   2008-04-14 11:56:47 
Re: shared_buffers performance
dev@[EMAIL PROTECTED] (R  2008-04-14 12:25:45 
Re: shared_buffers performance
gsmith@[EMAIL PROTECTED]   2008-04-14 11:44:44 
Re: shared_buffers performance
tgl@[EMAIL PROTECTED] (T  2008-04-14 15:31:54 
Re: shared_buffers performance
stark@[EMAIL PROTECTED]   2008-04-14 20:58:21 
Re: shared_buffers performance
gsmith@[EMAIL PROTECTED]   2008-04-14 16:08:48 
Re: shared_buffers performance
gsmith@[EMAIL PROTECTED]   2008-04-14 11:42:50 
Re: shared_buffers performance
Gaetano Mendola <mendo  2008-04-15 11:05:12 
Re: shared_buffers performance
Gaetano Mendola <mendo  2008-04-15 11:11:31 
Vacuum settings
dforums@[EMAIL PROTECTED]  2008-04-20 19:48:53 
Re: Vacuum settings
alvherre@[EMAIL PROTECTED  2008-04-21 11:03:37 
Re: shared_buffers performance
mendola@[EMAIL PROTECTED]  2008-04-15 17:08:02 
Re: Vacuum settings
gc@[EMAIL PROTECTED] (Gu  2008-04-21 17:31:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 15:30:44 CDT 2008.