Re: postgres optimization (effective_cache_size)

From: <ogjunk-pgjedan(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: postgres optimization (effective_cache_size)
Date: 2005-08-12 22:48:19
Message-ID: 20050812224819.30546.qmail@web31112.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

I followed this advice for picking a good effective_cache_size value
(below) from Scott Marlowe, and run into a bit of trouble:

I looked at the `top' output and saw "721380k cached".
So I calculated the effective cache size using Scott's formula:

721380/8 = 90172

Then I changed my effective_cache size from the previous 10000 to
90172:

effective_cache_size = 90172 # typically 8KB each

I restarted PG, and thought I'd see some performance improvements, but
I actually saw degradation in performance. All of a sudden a query
that took a second started taking a few seconds, and consumed more CPU
than before.

Can anyone explain this drop in performance and increase in CPU usage
and tell me what I did wrong?

I also noticed that the "721380k cached" number in top dropped to about
300000k (about a half). Maybe that was simply due to PG restart? If
so, does that indicate the kernel had about 400,000K worth of PG data
cached?

Thanks,
Otis

--- Scott Marlowe <smarlowe(at)g2switchworks(dot)com> wrote:

> Effective cache size just tells the query planner about how much
> memory
> the OS is using to cache your dataset.
>
> Bring the machine up, run lots of queries, and check the cache and
> buffers with top, and there's your amount. divide by 8k to get the
> setting for effective cache size.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Steve Lane 2005-08-12 22:52:46 Re: Log stdout in PG 8?
Previous Message Joshua D. Drake 2005-08-12 21:50:44 Re: pg_restore