Performance Testing Utility
Performance Testing Utility
От:
Christo Du Preez <christo@mecola.com>
Дата:
Hi All, Is there some kind of performance testing utility available for postgresql Something I can run after installing postgresql to help me identify if my installation is optimal. I've been battling for days now trying to sort out performance issues and something like that may just identify issues I'm not even aware of or considering at this stage. Regards, Christo Du Preez
Re: Performance Testing Utility
От:
Heikki Linnakangas <heikki@enterprisedb.com>
Дата:
Christo Du Preez wrote: > Is there some kind of performance testing utility available for > postgresql Something I can run after installing postgresql to help me > identify if my installation is optimal. Not really. There's contrib/pgbench, but I wouldn't recommend using it for that purpose since the optimal configuration depends on your application, and pgbench is likely nothing like your application. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
Re: Performance Testing Utility
От:
Tobias Brox <tobias@nordicbet.com>
Дата:
[Christo Du Preez - Wed at 12:25:20PM +0200]
> Is there some kind of performance testing utility available for
> postgresql Something I can run after installing postgresql to help me
> identify if my installation is optimal.
>
> I've been battling for days now trying to sort out performance issues
> and something like that may just identify issues I'm not even aware of
> or considering at this stage.
If you are really having performance problems, my general experience is
that you should look into the queries and usage patterns rather than the
configuration. The server configuration can only give marginal
benefits, compared to query and usage tuning.
It often a good idea to turn on the stats collector, even if it slows
down postgres a bit.
One of the things the stats collector gives is the pg_stat_activity
view, where you can find everything the server is working on exactly
now; checking up this view while you are actually experiencing
problems can give a lot of information.
Another thing I've noticed, is that the activity from our applications
often can come in bursts; the server can be like 70% idle most of the
time, but when the server is struck by 4-5 IO-heavy queries at the
same time in addition to the steady flow of simple queries, it can
easily get trashed. I've made up an algorithm to stop this from
happening, before running a transaction which is either heavy or not
considered very important, the activity view will be scanned, and if
the server is already working with many queries, the application will
sleep a bit and try again - and eventually return an error message
("please try again later") if it's doing interactive stuff.
Another thing that we've experienced - be aware of pending
transactions! It's important to commit or roll back every transaction
within reasonable time - if (i.e. due to a programming mistake or a
DBA starting a transaction in psql) a transaction is pending for
several hours or even ays, it is really very bad for the performance.
Another experience we have is that autovacuum can be quite naughty
when one has some really huge tables. This can be tweaked by
disabling autovacuum at those tables, and running a nightly vacuum
instead.
Apologies for not replying to your question, though ;-)
Re: Performance Testing Utility
От:
Vivek Khera <vivek@khera.org>
Дата:
On Jun 13, 2007, at 6:25 AM, Christo Du Preez wrote: > Is there some kind of performance testing utility available for > postgresql Something I can run after installing postgresql to help me > identify if my installation is optimal. Your own app is the only one that will give you meaningful results... You need to either run your app against it or simulate your applications' access patterns. Any other load will lead to different optimizations.