pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Slow system due to ReorderBufferGetTupleBuf?
4+ messages / 2 participants
[nested] [flat]

* Slow system due to ReorderBufferGetTupleBuf?
@ 2018-01-01 16:56  Martin Moore <martin.moore@avbrief.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Martin Moore @ 2018-01-01 16:56 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Postgres v10 on Debian stretch

I’m suffering from an occasionally very slow system. A few weeks ago someone mentioned using perf. I’ve installed this and caught the system during a slow period. It shows the following as the top cpu users:

9.09%  postgres                      [.] ReorderBufferGetTupleBuf
6.14%  postgres                      [.] ReorderBufferReturnChange



When ReorderBufferReturnChange is no longer running:

14.35%  postgres                      [.] ReorderBufferGetTupleBuf


Can someone shed some light on this and advise how to prevent it reoccurring?


Cheers,

Martin.






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Slow system due to ReorderBufferGetTupleBuf?
@ 2018-01-01 17:44  Peter Geoghegan <pg@bowt.ie>
  parent: Martin Moore <martin.moore@avbrief.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Peter Geoghegan @ 2018-01-01 17:44 UTC (permalink / raw)
  To: Martin Moore <martin.moore@avbrief.com>; +Cc: pgsql-general@lists.postgresql.org

On Mon, Jan 1, 2018 at 8:56 AM, Martin Moore <martin.moore@avbrief.com> wrote:
> Can someone shed some light on this and advise how to prevent it reoccurring?

You're using v10, which has these two commits:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=58b25e98106dbe062cec0f3d31d64977bffaa...

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9fab40ad32efa4038d19eaed975bb4c1713cc...

Unfortunately, per the commit message of the first commit, it doesn't
look like the tuple allocator uses any new strategy, at least until
this v11 commit:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a4ccc1cef5a04cc054af83bc4582a045d5232...

My guess is that that would make a noticeable difference, once v11
becomes available. Could you test this yourself by building from the
master branch?

-- 
Peter Geoghegan




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Slow system due to ReorderBufferGetTupleBuf?
@ 2018-01-02 12:09  Martin Moore <martin.moore@avbrief.com>
  parent: Peter Geoghegan <pg@bowt.ie>
  0 siblings, 1 reply; 4+ messages in thread

From: Martin Moore @ 2018-01-02 12:09 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org



On 01/01/2018, 17:45, "Peter Geoghegan" <pg@bowt.ie> wrote:

    On Mon, Jan 1, 2018 at 8:56 AM, Martin Moore <martin.moore@avbrief.com> wrote:
    > Can someone shed some light on this and advise how to prevent it reoccurring?
    
    You're using v10, which has these two commits:
    
    https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=58b25e98106dbe062cec0f3d31d64977bffaa...
    
    https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9fab40ad32efa4038d19eaed975bb4c1713cc...
    
    Unfortunately, per the commit message of the first commit, it doesn't
    look like the tuple allocator uses any new strategy, at least until
    this v11 commit:
    
    https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a4ccc1cef5a04cc054af83bc4582a045d5232...
    
    My guess is that that would make a noticeable difference, once v11
    becomes available. Could you test this yourself by building from the
    master branch?
    
    -- 
    Peter Geoghegan
    




Thanks Peter. I don’t really want to go down that route for various reasons. There’s a task that copies ‘old’ rows to various old_  tables and then deletes from the main tables, then does a vaccum and analyse. Tables only have 20-30k rows. I’m guessing this may be the trigger for the problem so have changed the timing from every 20 mins to once in the middle of the night when things are quiet.

Would this explain the problem?


Martin.









^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Slow system due to ReorderBufferGetTupleBuf?
@ 2018-01-02 21:28  Martin Moore <martin.moore@avbrief.com>
  parent: Martin Moore <martin.moore@avbrief.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Martin Moore @ 2018-01-02 21:28 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org



On 02/01/2018, 12:09, "Martin Moore" <martin.moore@avbrief.com> wrote:

    
    
    On 01/01/2018, 17:45, "Peter Geoghegan" <pg@bowt.ie> wrote:
    
        On Mon, Jan 1, 2018 at 8:56 AM, Martin Moore <martin.moore@avbrief.com> wrote:
        > Can someone shed some light on this and advise how to prevent it reoccurring?
        
        You're using v10, which has these two commits:
        
        https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=58b25e98106dbe062cec0f3d31d64977bffaa...
        
        https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9fab40ad32efa4038d19eaed975bb4c1713cc...
        
        Unfortunately, per the commit message of the first commit, it doesn't
        look like the tuple allocator uses any new strategy, at least until
        this v11 commit:
        
        https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a4ccc1cef5a04cc054af83bc4582a045d5232...
        
        My guess is that that would make a noticeable difference, once v11
        becomes available. Could you test this yourself by building from the
        master branch?
        
        -- 
        Peter Geoghegan
        
    
    
    
    
    Thanks Peter. I don’t really want to go down that route for various reasons. There’s a task that copies ‘old’ rows to various old_  tables and then deletes from the main tables, then does a vaccum and analyse. Tables only have 20-30k rows. I’m guessing this may be the trigger for the problem so have changed the timing from every 20 mins to once in the middle of the night when things are quiet.
    
    Would this explain the problem?
    
    
    Martin.
    
    
    ======================================================================================================


Having stopped the suspect task, I’m still getting the same problem. Can’t even stop postgres:

waiting for server to shut down............................................................... failed
pg_ctl: server does not shut down


We’ve spent 2 yrs and a chunk of cash on a total system redesign and this is going to stop it from being released.

Can someone give me an idea what may be causing this – and what ReorderBufferGetTupleBuf is actually doing in case it gives me a clue.

Thanks.






    
    
    






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2018-01-02 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01 16:56 Slow system due to ReorderBufferGetTupleBuf? Martin Moore <martin.moore@avbrief.com>
2018-01-01 17:44 ` Peter Geoghegan <pg@bowt.ie>
2018-01-02 12:09   ` Martin Moore <martin.moore@avbrief.com>
2018-01-02 21:28     ` Martin Moore <martin.moore@avbrief.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