Re: stats collector process high CPU utilization

From: Benjamin Minshall <minshall(at)intellicon(dot)biz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: stats collector process high CPU utilization
Date: 2007-02-08 21:55:25
Message-ID: 45CB9C4D.30902@intellicon.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane wrote:
> Benjamin Minshall <minshall(at)intellicon(dot)biz> writes:
>> Tom Lane wrote:
>>> Can you gather some info about what it's doing?
>>> strace'ing the stats collector might prove interesting, also if you have
>>> built it with --enable-debug then oprofile results would be helpful.
>
>> I will gather some strace info later today when I have a chance to
>> shutdown the server.
>
> I don't see why you'd need to shut anything down. Just run
> strace -p stats-process-ID
> for a few seconds or minutes (enough to gather maybe a few thousand
> lines of output).
>

Seems the problem may be related to a huge global/pgstat.stat file.
Under 8.1.5 it was about 1 MB; now it's 90 MB in 8.2.3.

I ran strace for 60 seconds:

% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
95.71 1.119004 48652 23 rename
4.29 0.050128 0 508599 write
0.00 0.000019 0 249 22 poll
0.00 0.000000 0 23 open
0.00 0.000000 0 23 close
0.00 0.000000 0 34 getppid
0.00 0.000000 0 23 munmap
0.00 0.000000 0 23 setitimer
0.00 0.000000 0 23 22 sigreturn
0.00 0.000000 0 23 mmap2
0.00 0.000000 0 23 fstat64
0.00 0.000000 0 216 recv
------ ----------- ----------- --------- --------- ----------------
100.00 1.169151 509282 44 total

I attached an excerpt of the full strace with the many thousands of
write calls filtered.

--
Benjamin Minshall <minshall(at)intellicon(dot)biz>
Senior Developer -- Intellicon, Inc.
http://www.intellicon.biz

Attachment Content-Type Size
strace.excerpt text/plain 2.1 KB

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-02-08 22:07:56 Re: stats collector process high CPU utilization
Previous Message Tom Lane 2007-02-08 21:24:22 Re: stats collector process high CPU utilization