Re: DB Getting Slower and Slower and Slower....

From: Doug McNaught <doug(at)wireboard(dot)com>
To: "Othman Laraki" <othman(at)epitrope(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: DB Getting Slower and Slower and Slower....
Date: 2001-05-04 04:18:34
Message-ID: m3g0eliw6d.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Othman Laraki" <othman(at)epitrope(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2001-05-04 04:40:14 Re: a primer on trigger?
Previous Message Othman Laraki 2001-05-04 04:17:25 RE: Can't get Postgres to use indices