Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V0a1v-0000wF-Lu for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2013 16:29:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1V0a1u-0004m0-U2 for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Jul 2013 16:29:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V0a1t-0004lt-Dd for pgsql-hackers@postgresql.org; Sat, 20 Jul 2013 16:29:09 +0000 Received: from moutng.kundenserver.de ([212.227.126.186]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1V0a1r-0006nh-6z for pgsql-hackers@postgresql.org; Sat, 20 Jul 2013 16:29:08 +0000 Received: from [192.168.1.110] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0LbgPT-1UFvTr176Z-00l0WC; Sat, 20 Jul 2013 18:29:01 +0200 Message-ID: <51EABACA.70701@2ndQuadrant.com> Date: Sat, 20 Jul 2013 12:28:58 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: didier CC: KONDO Mitsumasa , Robert Haas , Heikki Linnakangas , PostgreSQL-development Subject: Re: Improvement of checkpoint IO scheduler for stable transaction responses References: <51B5AFB1.5030404@lab.ntt.co.jp> <51BDCB6C.1090507@vmware.com> <51BEB6F5.7070907@lab.ntt.co.jp> <51C40EF4.1080201@lab.ntt.co.jp> <51C9D03B.10107@vmware.com> <51C9FD5C.5050706@vmware.com> <51E2F865.8030406@2ndQuadrant.com> <51E80CBC.10204@2ndQuadrant.com> <51E8F080.4040506@lab.ntt.co.jp> <51E943A1.9030702@2ndQuadrant.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:VjnTvPCAnGkKNwJvM5IOIEHuM/MAzqzkJA8gtJJP8W4 BLDoC+biU6VQrWlyu/Kp9tXSGIpU/UZo6Lkd7a817ZR+P+xNag CYJ+DghrAZ1UjhaKW4wGU0fFH2hdMVBYL4Ea0NyZoLz6OGBCGG lEpUUoaax1TWxQ3U7fidt7Y2+amCA2mjUesBQHjSR2qLXSI0o8 RUPbN0TmvTMj4BFyVTVC6WrpJB/iE0hL6SX00gp9mD96Wl+Cec 4nbhvNoTDrbGGzihVPwV+0azU7/5KO+8Z6UNw7jY8O0UNpuY2u UdAFXsaL3dHHy+5iPk8XelsxVNFgAzo++2hfSR9NwyGFiAGz8b 82QG+8Zrf6BgNI7Uj1u4= X-Pg-Spam-Score: -0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 7/20/13 4:48 AM, didier wrote: > With your tests did you try to write the hot buffers first? ie buffers > with a high refcount, either by sorting them on refcount or at least > sweeping the buffer list in reverse? I never tried that version. After a few rounds of seeing that all changes I tried were just rearranging the good and bad cases, I got pretty bored with trying new changes in that same style. > by writing to the OS the less likely to be recycle buffers first it may > have less work to do at fsync time, hopefully they have been written by > the OS background task during the spread and are not re-dirtied by other > backends. That is the theory. In practice write caches are so large now, there is almost no pressure forcing writes to happen until the fsync calls show up. It's easily possible to enter the checkpoint fsync phase only to discover there are 4GB of dirty writes ahead of you, ones that have nothing to do with the checkpoint's I/O. Backends are constantly pounding the write cache with new writes in situations with checkpoint spikes. The writes and fsync calls made by the checkpoint process are only a fraction of the real I/O going on. The volume of data being squeezed out by each fsync call is based on total writes to that relation since the checkpoint. That's connected to the writes to that relation happening during the checkpoint, but the checkpoint writes can easily be the minority there. It is not a coincidence that the next feature I'm working on attempts to quantify the total writes to each 1GB relation chunk. That's the most promising path forward on the checkpoint problem I've found. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers