"Othman Laraki" <othman@epitrope.com> writes:
> I recently upgraded to V7.1 version of Postgres on Linux and have
> noticed that as the DB is being used, it gets progressively slower
> and slower, until very simple queries slow down to a crawl.
First question: are you VACUUMing enough? How active is the DB with
respect to inserts/updates? You should be doing VACUUM ANALYZE at
least nightly (some people with very busy databases do it every couple
hours).
> The
> basic setup I have is a set of JSPs and Servlets running on Tomcat,
> that use Java classes which connect to Postgres through a JDBC
> driver and perform various DB operations. But, as I said, the DB
> gets noticeably slower, as if it does not clean up behind itself
> after performing operations and finally runs out of memory... Then,
> the only thing that works is stopping the postmaster and rebooting
> the machine.
Very odd. You certainly shouldn't have to reboot to reclaim memory;
restarting the postmaster should be enough.
Are you sure the Java app or some other process isn't eating up all
the memory? I was getting PG backend crashes due to lack of memory
every few days for a while, and finally found that it was my
webserver that was running away with itself...
Also make sure you're using the latest JDBC driver (early 7.1 RPMs had
one that was out of date).
Are you doing connection pooling in your web app? Or does each
servlet/JSP connect and disconnect on its own?
-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan