Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0B2386325B0 for ; Mon, 22 Feb 2010 21:05:04 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 74935-07 for ; Tue, 23 Feb 2010 01:04:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mail.postgresql.org (Postfix) with ESMTP id D6B8263258C for ; Mon, 22 Feb 2010 21:04:52 -0400 (AST) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0M4Tee-1Na30y3I2m-00z8fS; Tue, 23 Feb 2010 02:04:37 +0100 Message-ID: <4B8329A3.4040003@2ndquadrant.com> Date: Mon, 22 Feb 2010 20:04:35 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Arjen van der Meijden CC: pgsql-performance@postgresql.org Subject: Re: SSD + RAID References: <201002211410.o1LEAht05941@momjian.us> <4B814920.1040204@cheapcomplexdevices.com> <4B82187A.7060604@2ndquadrant.com> <4B822DFF.50501@tweakers.net> In-Reply-To: <4B822DFF.50501@tweakers.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19fECfW36HgtuWp3nK9VAw7K/S5dNYn+a5nR6w cg0IzVyBY3pq4OGBSbdT5BmUfvokIUPvJpGC1s2pEZhGE1Jy6G NsTfPVvnO8y1RlmA1oZxwz+hl50IuZb X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.427 tagged_above=-10 required=5 tests=AWL=0.172, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/307 X-Sequence-Number: 37728 Arjen van der Meijden wrote: > That's weird. Intel's SSD's didn't have a write cache afaik: > "I asked Intel about this and it turns out that the DRAM on the Intel > drive isn't used for user data because of the risk of data loss, > instead it is used as memory by the Intel SATA/flash controller for > deciding exactly where to write data (I'm assuming for the wear > leveling/reliability algorithms)." > http://www.anandtech.com/cpuchipsets/intel/showdoc.aspx?i=3403&p=10 Read further down: "Despite the presence of the external DRAM, both the Intel controller and the JMicron rely on internal buffers to cache accesses to the SSD...Intel's controller has a 256KB SRAM on-die." That's the problematic part: the Intel controllers have a volatile 256KB write cache stored deep inside the SSD controller, and issuing a standard SATA write cache flush command doesn't seem to clear it. Makes the drives troublesome for database use. > I can understand a SSD might do unexpected things when it loses power > all of a sudden. It will probably try to group writes to fill a single > block (and those blocks vary in size but are normally way larger than > those of a normal spinning disk, they are values like 256 or 512KB) > and it might loose that "waiting until a full block can be > written"-data or perhaps it just couldn't complete a full block-write > due to the power failure. > Although that behavior isn't really what you want, it would be > incorrect to blame write caching for the behavior if the device > doesn't even have a write cache ;) If you write data and that write call returns before the data hits disk, it's a write cache, period. And if that write cache loses its contents if power is lost, it's a volatile write cache that can cause database corruption. The fact that the one on the Intel devices is very small, basically just dealing with the block chunking behavior you describe, doesn't change either of those facts. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us