From: | andres(at)anarazel(dot)de (Andres Freund) |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, 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:31:16 |
Message-ID: | 20160706213116.75xgxiwva5gynkh3@alap3.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
On 2016-07-06 17:26:00 -0400, Alvaro Herrera wrote:
> 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).
Hrmpf.
> > 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.
That was primarily for allocation performance, but that's not far off.
Michael, what you could do is to adjust
static const Size max_cached_changes = 4096 * 2;
static const Size max_cached_tuplebufs = 4096 * 2; /* ~8MB */
static const Size max_cached_transactions = 512;
to some ridiculous sizes, and see how that affects performance.
> Maybe it'd be worthwhile to implement a different
> MemoryContext tailored to this use case, and remove the slab cache
> stuff.
Hm. I'm not sure how much you could do with a memory context
itself. Seems to need an actual slab allocator, something not easily
done via the MemoryContext interface.
Andres
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2016-07-06 21:38:28 | Re: BUG #14231: logical replication wal sender process spins when using error traps in function |
Previous Message | Alvaro Herrera | 2016-07-06 21:26:00 | Re: BUG #14231: logical replication wal sender process spins when using error traps in function |