Re: Pg stuck at 100% cpu, for multiple days - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Pg stuck at 100% cpu, for multiple days
Date
Msg-id CAA4eK1+6J6+hWCkbVfRe2VoN4L9rOnd0Jfb57r67WD-ApbfMGA@mail.gmail.com
Whole thread Raw
In response to Re: Pg stuck at 100% cpu, for multiple days  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: Pg stuck at 100% cpu, for multiple days
List pgsql-hackers
On Tue, Aug 31, 2021 at 11:41 AM hubert depesz lubaczewski
<depesz@depesz.com> wrote:
>
> On Mon, Aug 30, 2021 at 09:09:20PM +0200, Laurenz Albe wrote:
> > On Mon, 2021-08-30 at 17:18 +0200, hubert depesz lubaczewski wrote:
> > > The thing is - I can't close it with pg_terminate_backend(), and I'd
> > > rather not kill -9, as it will, I think, close all other connections,
> > > and this is prod server.
> >
> > Of course the cause should be fixed, but to serve your immediate need:
> >
> > After calling pg_terminate_backend(), you can attach gdb to the backend and then run
> >
> >   print ProcessInterrupts()
> >
> > That will cause the backend to exit normally without crashing the server.
>
> I got this mail too late, and the decision was made to restart Pg. After
> restart all cleaned up nicely.
>
> So, while I can't help more with diagnosing the problem, I think it
> might be good to try to figure out what could have happened.
>

One possibility could be there are quite a few DDLs happening in this
application at some particular point in time which can lead to high
CPU usage. Prior to commit d7eb52d718 in PG-14, we use to execute all
invalidations at each command end during logical decoding which might
lead to such behavior temporarily. I think a bit of debugging when it
shows this symptom could help us to identify if it is the problem I am
speculating here.

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: perlcritic: prohibit map and grep in void conext
Next
From: Amit Kapila
Date:
Subject: Re: Added schema level support for publication.