Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9FD5B632B50 for ; Fri, 16 Jul 2010 13:55:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 03516-04 for ; Fri, 16 Jul 2010 16:55:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mail.postgresql.org (Postfix) with ESMTP id D37D4632D4D for ; Fri, 16 Jul 2010 13:55:33 -0300 (ADT) Received: from [192.168.1.3] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M36xf-1OtFzR29B9-00sGuT; Fri, 16 Jul 2010 18:55:31 +0200 Message-ID: <4C408F01.2080501@2ndquadrant.com> Date: Fri, 16 Jul 2010 12:55:29 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Scott Carey CC: Ben Chobot , Craig James , "Timothy.Noonan@emc.com" , PostgreSQL - Performance Subject: Re: performance on new linux box References: <4C360677.1090608@emolecules.com> <95971335.20100708211351@erwied.eu> <488953776.20100708213233@erwied.eu> <4C35E4CA020000250003327E@gw.wicourts.gov> <4C363CAE.7010401@emolecules.com> <4C36462E.1080405@emolecules.com> <822 F9CEE-570F-43F7-980F-A721EA7952D1@richrelevance.com> <0BC62364-BD19-41E0-A483-677474CD5A5D@richrelevance.com> <6A7F9A16-F50B-43AE-B349-174726564292@silentmedia.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:FoChjaq4EZwkfezj7emUeWWAp3YjQDBn3vxtCBRAsjW 3GmngenrDHv+iFk+eN5teQFf6jY5BNJE+8RkQEJxVKWDRxFmk+ 4IlDouqhA4s81WQGwAoM06oIZ+0o7d8jg/m4ny4j3PeQOVaCjO MQfltjyAmkapRrxJY+TAseQdb0F9Z0SxUMpZDmWIEBID3536hf OaI+qNUVWoBsiElOt+4Cgl8iNF9P+poVsZF4zhFyks= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_40=-0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201007/263 X-Sequence-Number: 39652 Scott Carey wrote: > As long as fsync() works _properly_ which is true for any file system + disk combination with a damn (not HFS+ on OSX, not FAT, not a few other things), then it will tell the drive to flush its cache _before_ fsync() returns. There is NO REASON for a raid card to turn off a drive cache unless it does not trust the drive cache. In write-through mode, it should not return to the OS with a fsync, direct write, or other "the OS thinks this data is persisted now" call until it has flushed the disk cache. That does not mean it has to turn off the disk cache. > Assuming that the operating system will pass through fsync calls to flush data all the way to drive level in all situations is an extremely dangerous assumption. Most RAID controllers don't know how to force things out of the individual drive caches; that's why they turn off write caching on them. Few filesystems get the details right to handle individual drive cache flushing correctly. On Linux, XFS and ext4 are the only two with any expectation that will happen, and of those two ext4 is still pretty new and therefore should still be presumed to be buggy. Please don't advise people about what is safe based on theoretical grounds here, in practice there are way too many bugs in the implementation of things like drive barriers to trust them most of the time. There is no substitute for a pull the plug test using something that looks for bad cache flushes, i.e. diskchecker.pl: http://brad.livejournal.com/2116715.html If you do that you'll discover you must turn off the individual drive caches when using a battery-backed RAID controller, and you can't ever trust barriers on ext3 because of bugs that were only fixed in ext4. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us