pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Yasuo Ohgaki <yasuo_ohgaki@hotmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Gradual increase in CPU utilization by postmaster
Date: Fri, 22 Jun 2001 11:31:08 +0900
Message-ID: <OE67bb1Say67xbHjkHX0000bfea@hotmail.com> (raw)
References: <NHEMKEOEIKGALJPGOPLEMEOGCKAA.anand@reefedge.com>
	<11939.993095491@sss.pgh.pa.us>
	<OE756Ei5InVMoyjIfzZ0000baae@hotmail.com>
	<13155.993133064@sss.pgh.pa.us>

> "Yasuo Ohgaki" <yasuo_ohgaki@hotmail.com> writes:
> > Postmaster size and CPU time increases gradually as time passes.
> > After 25 minutes elapsed, postmaster size became about 7000.
> > CPU time increased to about 90% from 70%.
> 
> > Terminating script and executing again will result in the same higher
> > CPU and memory usage.
> > Vacuuming table seems to reset this behavior.
> 
> Wait a minute, are we talking about *postmaster* size or *backend* size?
> 
> regards, tom lane

Sorry for the ambiguous description. It's *backend* size.
CPU usage and Memory size of the backend process continuously 
grows.  When I start the script, most of CPU time is used by 
system, and user time increases gradually.
Once CPU and Memory usage is increased, new backend, that uses the
table, end up with using the increased amount of resources (CPU and 
memory). To reset this behavior, the table is needed to be vacuumed 
and all backends, which are using the table, are needed to be terminated.

Table is very simple and has only 1 record.
test_table.sql
--------
CREATE TABLE test_table (
key  text,
val  text);

INSERT INTO test_table
(key,val) VALUES
('abc', 'aaa');
---------

Script 
pgtest.sh
--------
#!/bin/sh
while ( true ) ; do
  echo "UPDATE test_table SET val='xyz' where key='abc'; "
done
---------
% psql -f test_table.sql
% pgtest.sh | psql -q

Hope this helps.

Regards,
--
Yasuo Ohgaki



view thread (6+ messages)

Message-ID: <OE67bb1Say67xbHjkHX0000bfea@hotmail.com>
Permalink:  ../OE67bb1Say67xbHjkHX0000bfea@hotmail.com/
Also on:    postgresql.org/message-id/OE67bb1Say67xbHjkHX0000bfea@hotmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: yasuo_ohgaki@hotmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Gradual increase in CPU utilization by postmaster
  In-Reply-To: <OE67bb1Say67xbHjkHX0000bfea@hotmail.com>
  References: <NHEMKEOEIKGALJPGOPLEMEOGCKAA.anand@reefedge.com> <11939.993095491@sss.pgh.pa.us> <OE756Ei5InVMoyjIfzZ0000baae@hotmail.com> <13155.993133064@sss.pgh.pa.us> <OE67bb1Say67xbHjkHX0000bfea@hotmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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