Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeRB2-00005P-VV for pgsql-performance@arkaria.postgresql.org; Fri, 30 Nov 2012 14:02:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TeRB1-0000tA-Si for pgsql-performance@arkaria.postgresql.org; Fri, 30 Nov 2012 14:02:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeRB0-0000t4-PU for pgsql-performance@postgresql.org; Fri, 30 Nov 2012 14:02:46 +0000 Received: from smtp.optionshouse.com ([38.98.137.6] helo=smtp.peak6.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeRAx-0001Gq-HX for pgsql-performance@postgresql.org; Fri, 30 Nov 2012 14:02:46 +0000 X-AuditID: 0a64cb20-b7fe66d000002e97-57-50b8bc816311 Message-ID: <50B8BC7F.4000005@optionshouse.com> Date: Fri, 30 Nov 2012 08:02:39 -0600 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Niels_Kristian_Schj=F8dt?= CC: Kevin Grittner , Willem Leenen , Subject: Re: Optimize update query References: <20121130012426.69300@gmx.com> <855F8817-6C9A-4EFB-BB80-752BF7B73B56@autouncle.com> In-Reply-To: <855F8817-6C9A-4EFB-BB80-752BF7B73B56@autouncle.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Length: 2541 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42LhSuGV0G3csyPA4NQTFYuXx+4wWyzddZbF 4vrMc8wWO9ftZXFg8eg8fJ7V43HPGTaPGU9Os3pc2DeNPYAlqoHRJjEvL78ksSRVISW1ONlW yb+gJDM/r9gjv7Q4VcElszg5JzEzN7VISSEzxVbJWEmhICcxOTU3Na/EVimxoCA1L0XJjksB A9gAlWXmKaTmJeenZOal2yp5BvvrWliYWuoaKtnFI4OETpaMI2tnsBRcFaq492M/ewPjAZ4u Rk4OCQETia3X7zFD2GISF+6tZwOxeQX0JU5f7mYEsVkEVCVaPl5kB7HZBHQlJvWvAKsRElCR 6Dt7gwnE5hcQltj3oQlsjqhAmMSaPYeYIOYISpyc+YSli5GDQ0TAW+JXSwJImFmgTGLi48es ILawgI5E06brQDYX0MgpjBJL/z0Am8Mp4Cix8cJLJogGW4kLc66zQNjyEs1bZzND3KAqsaJ5 IhvE/QoS/6+8Y5rAKDQLyepZSNpnIWlfwMi8ilG8uCwxOSPTtKA4t6TASK8gNTHbTC8vtWQT IzjCTyvsYPzeaXWIUYCDUYmHd8Gi7QFCrIllxZW5hxglOJiVRHj/btwRIMSbklhZlVqUH19U mpNafIjRBxhmE5mlRJPzgcknryTe0NjUwNTS1NDU3NTQCIewkjhvaOiiACGBdGAqyU5NLUgt ghnHxMEp1cDYNqHT+PwMy7oEJ5tplza9vDRLQfM4G3On0E6BfQ57RWYpb8qKORUebxzks0n7 q7/K9JlX0vmn9LGftbBk1jC21Jr+ob448er6lofL7U8rGLbZsF/a+vva/6ML/TbY2gWHinW9 Srqq/mxDuM/3BYbW2g+PLStM18pOF5IM/lZz6FTIt6iOM6VKLMUZiYZazEXFiQAYHSUBHQMA AA== X-Pg-Spam-Score: -2.3 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 11/29/2012 08:32 PM, Niels Kristian Schj=F8dt wrote: > If I do a "sudo iostat -k 1" > I get a lot of output like this: > Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn > sda 0.00 0.00 0.00 0 0 > sdb 0.00 0.00 0.00 0 0 > sdc 546.00 2296.00 6808.00 2296 6808 > sdd 593.00 1040.00 7416.00 1040 7416 > md1 0.00 0.00 0.00 0 0 > md0 0.00 0.00 0.00 0 0 > md2 1398.00 3328.00 13064.00 3328 13064 > md3 0.00 0.00 0.00 0 0 > > The storage thing is, that the sda and sdb is the SSD drives and the > sdc and sdd is the HDD drives. The md0, md1 and md2 is the raid > arrays on the HDD's and the md3 is the raid on the SSD's. Neither of > the md3 or the SSD's are getting utilized - and I should expect that > since they are serving my pg_xlog right? No, that's right. They are, but it would appear that the majority of your traffic actually isn't due to transaction logs like I'd suspected. If you get a chance, could you monitor the contents of: /var/lib/postgresql/9.2/main/base/pgsql_tmp Your main drives are getting way, way more writes than they should. 13MB per second is ridiculous even under heavy write loads. Based on the TPS count, you're basically saturating the ability of those two 3TB drives. Those writes have to be coming from somewhere. > # sudo mkdir -p /ssd/pg_xlog This is going to sound stupid, but are you *sure* the SSD is mounted at /ssd ? > # sudo chown -R postgres.postgres /ssd/pg_xlog > # sudo chmod 700 /ssd/pg_xlog > # sudo cp -rf /var/lib/postgresql/9.2/main/pg_xlog/* /ssd/pg_xlog > # sudo mv /var/lib/postgresql/9.2/main/pg_xlog /var/lib/postgresql/9.2/= main/pg_xlog_old > # sudo ln -s /ssd/pg_xlog /var/lib/postgresql/9.2/main/pg_xlog > # sudo /etc/init.d/postgresql-9.2 start The rest of this is fine, except that you probably should have added: sudo chown -R postgres:postgres /ssd/pg_xlog/* -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@optionshouse.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related= to this email --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance