Re: Protect syscache from bloating with negative cache entries

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, 'Kyotaro HORIGUCHI' <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: "alvherre(at)2ndquadrant(dot)com" <alvherre(at)2ndquadrant(dot)com>, "bruce(at)momjian(dot)us" <bruce(at)momjian(dot)us>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "robertmhaas(at)gmail(dot)com" <robertmhaas(at)gmail(dot)com>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Ideriha, Takeshi" <ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "michael(dot)paquier(at)gmail(dot)com" <michael(dot)paquier(at)gmail(dot)com>, "david(at)pgmasters(dot)net" <david(at)pgmasters(dot)net>, "craig(at)2ndquadrant(dot)com" <craig(at)2ndquadrant(dot)com>
Subject: Re: Protect syscache from bloating with negative cache entries
Date: 2019-02-19 11:53:25
Message-ID: d34689a2-12fd-5a56-2805-22f5b20d6c63@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2/19/19 12:43 AM, Tsunakawa, Takayuki wrote:
> Hi Horiguchi-san,
>
> I've looked through your patches. This is the first part of my review results. Let me post the rest after another work today.
>
> BTW, how about merging 0003 and 0005, and separating and deferring 0004 in another thread? That may help to relieve other community members by making this patch set not so large and complex.
>
>
>
> [Bottleneck investigation]
> Ideriha-san and I are trying to find the bottleneck. My first try shows there's little overhead. Here's what I did:
>
> <postgresql.conf>
> shared_buffers = 1GB
> catalog_cache_prune_min_age = -1
> catalog_cache_max_size = 10MB
>
> <benchmark>
> $ pgbench -i -s 10
> $ pg_ctl stop and then start
> $ cache all data in shared buffers by running pg_prewarm on branches, tellers, accounts, and their indexes
> $ pgbench --select-only -c 1 -T 60
>
> <result>
> master : 8612 tps
> patched: 8553 tps (-0.7%)
>
> There's little (0.7%) performance overhead with:
> * one additional dlist_move_tail() in every catcache access
> * memory usage accounting in operations other than catcache access (relevant catcache entries should be cached in the first pgbench transaction)
>
> I'll check other patterns to find out how big overhead there is.
>

0.7% may easily be just a noise, possibly due to differences in layout
of the binary. How many runs? What was the variability of the results
between runs? What hardware was this tested on?

FWIW I doubt tests with such small small schema are proving anything -
the cache/lists are likely tiny. That's why I tested with much larger
number of relations.

regards

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-02-19 11:54:31 Re: Prepared transaction releasing locks before deregistering its GID
Previous Message Michael Meskes 2019-02-19 11:21:22 Re: [Bug Fix] ECPG: could not use set xxx to default statement