Re: BUG #14231: logical replication wal sender process spins when using error traps in function

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: blake(at)rcmail(dot)com, pgsql-bugs(at)postgresql(dot)org, Andres Freund <andres(at)anazarel(dot)de>
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Date: 2016-07-06 21:26:00
Message-ID: 20160706212600.GA649263@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Gierth wrote:

> A quick scan of the code suggests that the worst case is when blocks are
> being freed in FIFO order, which seems quite plausible in this case, and
> the performance is potentially O(N^2).
>
> So I think this is primarily an artifact of doing so much retail
> palloc/pfree in a single memory context.

As I recall, this is the main reason Andres stuck the slab cache in
reorderbuffer. Maybe it'd be worthwhile to implement a different
MemoryContext tailored to this use case, and remove the slab cache
stuff.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2016-07-06 21:31:16 Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Previous Message Peter Geoghegan 2016-07-06 21:23:33 Re: BUG #14231: logical replication wal sender process spins when using error traps in function