pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres processes have a burst of CPU usage
2+ messages / 2 participants
[nested] [flat]
* Postgres processes have a burst of CPU usage
@ 2007-01-23 16:11 Subramaniam Aiylam <aiylam_s@yahoo.com>
0 siblings, 1 reply; 2+ messages in thread
From: Subramaniam Aiylam @ 2007-01-23 16:11 UTC (permalink / raw)
To: pgsql-performance
Hello all,
I have a setup in which four client machines access
a Postgres database (8.1.1) (on a Linux box). So,
there are connections from each machine to the
database; hence, the Linux box has about 2 postgres
processes associated with each machine.
I am using the JDBC driver
(postgresql-8.1-404.jdbc3.jar) to talk to the
database. I am also using the Spring framework(1.2.2)
and Hibernate (3.0.5) on top of JDBC. I use Apache's
DBCP database connection pool (1.2.1).
Now, there is one particular update that I make from
one of the client machines - this involves a
reasonably large object graph (from the Java point of
view). It deletes a bunch of rows (around 20 rows in
all) in 4-5 tables and inserts another bunch into the
same tables.
When I do this, I see a big spike in the CPU usage
of postgres processes that are associated with ALL the
client machines, not just the one I executed the
delete/insert operation on. The spike seems to happen
a second or two AFTER the original update completes
and last for a few seconds.
Is it that this operation is forcibly clearing some
client cache on ALL the postgres processes? Why is
there such an interdependency? Can I set some
parameter to turn this off?
Regards and thanks,
S.Aiylam
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Postgres processes have a burst of CPU usage
@ 2007-01-24 08:49 Richard Huxton <dev@archonet.com>
parent: Subramaniam Aiylam <aiylam_s@yahoo.com>
0 siblings, 0 replies; 2+ messages in thread
From: Richard Huxton @ 2007-01-24 08:49 UTC (permalink / raw)
To: Subramaniam Aiylam <aiylam_s@yahoo.com>; +Cc: pgsql-performance
Subramaniam Aiylam wrote:
> Now, there is one particular update that I make from
> one of the client machines - this involves a
> reasonably large object graph (from the Java point of
> view). It deletes a bunch of rows (around 20 rows in
> all) in 4-5 tables and inserts another bunch into the
> same tables.
>
> When I do this, I see a big spike in the CPU usage
> of postgres processes that are associated with ALL the
> client machines, not just the one I executed the
> delete/insert operation on. The spike seems to happen
> a second or two AFTER the original update completes
> and last for a few seconds.
So what are the other backends doing? They're not going to be using CPU
cycles for nothing, they must be executing queries. Perhaps turn on
statement logging, and track process IDs.
I can't think of any PostgreSQL caching that would be seriously affected
by updating a few dozen rows. It might be that one of your java
libraries is clearing its cache though, causing it to issue more queries.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-01-24 08:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 16:11 Postgres processes have a burst of CPU usage Subramaniam Aiylam <aiylam_s@yahoo.com>
2007-01-24 08:49 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox