Re: pl/pgsql function spikes CPU 100%

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pl/pgsql function spikes CPU 100%
Date: 2007-03-16 14:49:25
Message-ID: 6522.1174056565@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jeff Frost <jeff(at)frostconsultingllc(dot)com> writes:
> ... Interestingly, when you
> strace the backend, it doesn't appear to be doing too much...here's some
> sample output:

> select(0, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout)
> semop(3932217, 0x7fbfffd150, 1) = 0
> semop(3932217, 0x7fbfffd150, 1) = 0
> semop(3932217, 0x7fbfffd150, 1) = 0
> semop(3932217, 0x7fbfffd150, 1) = 0
> semop(3932217, 0x7fbfffd150, 1) = 0
> select(0, NULL, NULL, NULL, {0, 1000}) = 0 (Timeout)
> semop(3997755, 0x7fbfffd170, 1) = 0
> semop(3932217, 0x7fbfffd150, 1) = 0

This looks suspiciously like the sort of trace we saw in the various
"context swap storm" threads. The test cases for those generally
involved really tight indexscan loops, ie, the backends were spending
all their time trying to access shared buffers. If you haven't changed
the function or the data, then I concur with the nearby worry about
autovacuuming (large buildup of dead tuples could result in this symptom).
Or maybe you've got an old open transaction that is blocking cleanup?

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Frost 2007-03-16 15:24:08 Re: pl/pgsql function spikes CPU 100%
Previous Message Jeff Frost 2007-03-16 14:46:23 Re: pl/pgsql function spikes CPU 100%