Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UzQR9-0002E1-HN for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jul 2013 12:02:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UzQR9-0007hA-0k for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jul 2013 12:02:27 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UzQR7-0007h4-Qy for pgsql-hackers@postgresql.org; Wed, 17 Jul 2013 12:02:25 +0000 Received: from szxga01-in.huawei.com ([119.145.14.64]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UzQR3-0000dU-Pg for pgsql-hackers@postgresql.org; Wed, 17 Jul 2013 12:02:25 +0000 Received: from 172.24.2.119 (EHLO szxeml210-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BFI15712; Wed, 17 Jul 2013 19:55:01 +0800 (CST) Received: from SZXEML460-HUB.china.huawei.com (10.82.67.203) by szxeml210-edg.china.huawei.com (172.24.2.183) with Microsoft SMTP Server (TLS) id 14.1.323.7; Wed, 17 Jul 2013 19:54:57 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml460-hub.china.huawei.com (10.82.67.203) with Microsoft SMTP Server id 14.1.323.7; Wed, 17 Jul 2013 19:54:58 +0800 From: Amit Kapila To: "'Ants Aasma'" , "'Greg Smith'" CC: "'Heikki Linnakangas'" , "'PostgreSQL-development'" , "'KONDO Mitsumasa'" References: <51B5AFB1.5030404@lab.ntt.co.jp> <51BDCB6C.1090507@vmware.com> <51E2F1C4.6010503@2ndQuadrant.com> In-Reply-To: Subject: Re: Improvement of checkpoint IO scheduler for stable transaction responses Date: Wed, 17 Jul 2013 17:24:57 +0530 Message-ID: <00a201ce82e4$76387950$62a96bf0$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6CRCy4ZVpfVFW8SH6U0cN4If73qAAnJC1A Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -2.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 Tuesday, July 16, 2013 10:16 PM Ants Aasma wrote: > On Jul 14, 2013 9:46 PM, "Greg Smith" wrote: > > I updated and re-reviewed that in 2011: > http://www.postgresql.org/message-id/4D31AE64.3000202@2ndquadrant.com > and commented on why I think the improvement was difficult to reproduce > back then. The improvement didn't follow for me either. It would take > a really amazing bit of data to get me to believe write sorting code is > worthwhile after that. On large systems capable of dirtying enough > blocks to cause a problem, the operating system and RAID controllers > are already sorting block. And *that* sorting is also considering > concurrent read requests, which are a lot more important to an > efficient schedule than anything the checkpoint process knows about. > The database doesn't have nearly enough information yet to compete > against OS level sorting. > > That reasoning makes no sense. OS level sorting can only see the > writes in the time window between PostgreSQL write, and being forced > to disk. Spread checkpoints sprinkles the writes out over a long > period and the general tuning advice is to heavily bound the amount of > memory the OS willing to keep dirty. This makes probability of > scheduling adjacent writes together quite low, the merging window > being limited either by dirty_bytes or dirty_expire_centisecs. The > checkpointer has the best long term overview of the situation here, OS > scheduling only has the short term view of outstanding read and write > requests. By sorting checkpoint writes it is much more likely that > adjacent blocks are visible to OS writeback at the same time and will > be issued together. I think Oracle also use similar concept for making writes efficient, and they have patent also for this technology which you can find at below link: http://www.google.com/patents/US7194589?dq=645987&hl=en&sa=X&ei=kn7mUZ-PIsWq rAe99oDgBw&sqi=2&pjf=1&ved=0CEcQ6AEwAw Although Oracle has different concept for performing checkpoint writes, but I thought of sharing the above link with you, so that unknowingly we should not go into wrong path. AFAIK instead of depending on OS buffers, they use direct I/O and infact in the patent above they are using temporary buffer (Claim 3) to sort the writes which is not the same idea as far as I can understand by reading above thread. With Regards, Amit Kapila. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers