Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw3yt-00030P-QT for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Feb 2019 11:54:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gw3xu-0003tC-Br for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Feb 2019 11:53:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw3xt-0003nx-Qx for pgsql-hackers@lists.postgresql.org; Tue, 19 Feb 2019 11:53:34 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw3xq-0004UI-Hf for pgsql-hackers@lists.postgresql.org; Tue, 19 Feb 2019 11:53:32 +0000 Received: by mail-wm1-x343.google.com with SMTP id y185so2024402wmd.1 for ; Tue, 19 Feb 2019 03:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Eh6diFOVQjwBPIgQLEMEO3sc0M/KbFevToPvWljfSCs=; b=0eD2tWunDqz6z04H3me4I3l9oPomcKAPhlHrzIPA751sbAPbcUDQWY6WNgzMUUd6aT Um6orgyR/37fIvFZWx2Co76qJGT3OKd3ULmKdUJ9Q0eydLGxfagb/ZmHmSZFdtH4hPdC g6KInDHGF6pofQdhPhNaGRosZvQPP0mSie+UAG2ga7G8UMnpQ/LOJyOMoRCbMzSRzgLx 08TuHyx1aw4Zrh+W6WSzpEUeTEH5gAGdG4i9Pm++k69RF/BLsduY1V6k36ecE5c88+Jw JiUt4yhUcW81UN8mVXPvmpys3NhKF3lYq6qmiSBIsPQn9SCw8N/xBsaCYwtGggETVNrK DXFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Eh6diFOVQjwBPIgQLEMEO3sc0M/KbFevToPvWljfSCs=; b=m1YxBnWgVRwsiJWQNkZkR0ape6SMai7vv7XTrN32y2aXYIMwgFYfHrOSKFO7MirWB2 Rs2yFMP1mxVe4GDufSDehE+NiUzIBEyX2wzpMmu4qzHSyC/tTKfWZ5glcHVVVVtE3s/2 O8sLJ6XYq2JDak7Yv1S8OoHp9ay0W3F6Gcv/HrFO2HLTQ1ggob4l5EDA2puBFS/sH1Kk 1ADD6ibo1Mu0a0amKs8XKrclQ0XRMCg00fbnVuIQD3fkOtCsfYB4Qr8pNr2iw0SCHPeB sZjH4mp7mP7IQwKzWd6zgbyoNI0r5nB0raJFnpIeo5AKESL8xK1y+a+Rs6c8Dj4zT+go FH6A== X-Gm-Message-State: AHQUAuZwGjwqBsRb910+5F5cfCDQge6cfQU4e5B7ZyZRhCZEwA41olZf 3WFyzct0YTsbTzXg6ejnqPGg0Q== X-Google-Smtp-Source: AHgI3IYXmp8tkhF40q7Yes5ZzxgMWHhPZ/Dsab893N/e3k+1dQq+isQG8G03cpsKWgexZjgyvlLCRA== X-Received: by 2002:a1c:4301:: with SMTP id q1mr2603178wma.44.1550577208731; Tue, 19 Feb 2019 03:53:28 -0800 (PST) Received: from [10.137.0.18] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id z6sm1936597wml.40.2019.02.19.03.53.26 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 03:53:27 -0800 (PST) Subject: Re: Protect syscache from bloating with negative cache entries To: "Tsunakawa, Takayuki" , 'Kyotaro HORIGUCHI' Cc: "alvherre@2ndquadrant.com" , "bruce@momjian.us" , "andres@anarazel.de" , "robertmhaas@gmail.com" , "tgl@sss.pgh.pa.us" , "Ideriha, Takeshi" , "pgsql-hackers@lists.postgresql.org" , "michael.paquier@gmail.com" , "david@pgmasters.net" , "craig@2ndquadrant.com" References: <20190207.211845.263152487.horiguchi.kyotaro@lab.ntt.co.jp> <0A3221C70F24FB45833433255569204D1FB972A6@G01JPEXMBYT05> <20190212.203628.118792892.horiguchi.kyotaro@lab.ntt.co.jp> <20190213.153114.239737674.horiguchi.kyotaro@lab.ntt.co.jp> <0A3221C70F24FB45833433255569204D1FB99888@G01JPEXMBYT05> <0A3221C70F24FB45833433255569204D1FB9D37E@G01JPEXMBYT05> From: Tomas Vondra Message-ID: Date: Tue, 19 Feb 2019 12:53:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <0A3221C70F24FB45833433255569204D1FB9D37E@G01JPEXMBYT05> Content-Type: text/plain; charset=iso-2022-jp Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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: > > > shared_buffers = 1GB > catalog_cache_prune_min_age = -1 > catalog_cache_max_size = 10MB > > > $ 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 > > > 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