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

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-bugs(at)postgresql(dot)org, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, blake(at)rcmail(dot)com, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function
Date: 2016-07-19 05:27:51
Message-ID: 20160719052751.5arxjvgkr34q6iff@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2016-07-19 07:04:43 +0200, Tomas Vondra wrote:
> So, I've spent a few hours experimenting with this idea, and I believe it
> seems like a good way forward. Attached is an early WIP patch that does
> this:

Cool! Thanks for looking into this.

> I'm not sure whether the SlabContext is needed here - perhaps AllocSets
> would do equally well, at least in this case. I however wonder whether the
> existing local slab cache can actually improve anything, because what I see
> is a long sequence of pallocs() followed by a long sequence of pfrees(),
> which makes any reuse impossible. But I guess there are other cases where
> the palloc() and pfree() calls are mixed.

In something more oltp like you'll see exactly that. IIRC, in pgbench,
we pretty much never allocate for the slab allocated stuff, after some
warmup.

> The other thing is that splitting the tuple context into two parts seems a
> bit wasteful - this mostly follows the MaxHeapTupleSize idea from the
> existing slab code, but how many tuples actually are this big?

The issue is that allocating them differently sized leads to massive
memory fragmentation over time.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message zzia88 2016-07-19 12:57:53 BUG #14259: i want to store XML version in our table postgres table.
Previous Message Tomas Vondra 2016-07-19 05:04:43 Re: BUG #14231: logical replication wal sender process spins when using error traps in function