Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeMlG-0004Lw-TV for pgsql-performance@arkaria.postgresql.org; Fri, 30 Nov 2012 09:19:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TeMlG-0002Et-3q for pgsql-performance@arkaria.postgresql.org; Fri, 30 Nov 2012 09:19:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeMlF-0002Eo-7s for pgsql-performance@postgresql.org; Fri, 30 Nov 2012 09:19:53 +0000 Received: from [2404:130:0:10::40:2] (helo=mail.catalyst.net.nz) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeMl9-00042C-Md for pgsql-performance@postgresql.org; Fri, 30 Nov 2012 09:19:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id 8622A328C4; Fri, 30 Nov 2012 22:19:40 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1S1SoQVDFMAl; Fri, 30 Nov 2012 22:19:28 +1300 (NZDT) Received: from [192.168.1.65] (122-60-64-230.jetstream.xtra.co.nz [122.60.64.230]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 7813432528; Fri, 30 Nov 2012 22:19:27 +1300 (NZDT) Message-ID: <50B87A1F.9020502@catalyst.net.nz> Date: Fri, 30 Nov 2012 22:19:27 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Vitalii Tymchyshyn CC: =?UTF-8?B?TmllbHMgS3Jpc3RpYW4gU2NoasO4ZHQ=?= , Kevin Grittner , sthomas@optionshouse.com, pgsql-performance@postgresql.org, Willem Leenen Subject: Re: Optimize update query References: <20121130012426.69300@gmx.com> <855F8817-6C9A-4EFB-BB80-752BF7B73B56@autouncle.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2404:130:0:10::40:2 (failed) X-Pg-Spam-Score: -1.1 (-) 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 Most modern SSD are much faster for fsync type operations than a=20 spinning disk - similar performance to spinning disk + writeback raid=20 controller + battery. However as you mention, they are great at random IO too, so Niels, it=20 might be worth putting your postgres logs *and* data on the SSDs and=20 retesting. Regards Mark On 30/11/12 21:37, Vitalii Tymchyshyn wrote: > Actually, what's the point in putting logs to ssd? SSDs are good for > random access and logs are accessed sequentially. I'd put table spaces > on ssd and leave logs on hdd > > 30 =D0=BB=D0=B8=D1=81=D1=82. 2012 04:33, "Niels Kristian Schj=C3=B8dt" > > =D0=BD= =D0=B0=D0=BF=D0=B8=D1=81. > > Hmm I'm getting suspicious here. Maybe my new great setup with the > SSD's is not really working as it should., and maybe new relic is > not monitoring as It should. > > 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? - so maybe I did something > wrong in the setup. Here is the path I followed: > > # 1) First setup the SSD drives in a software RAID1 setup: > # > http://askubuntu.com/questions/223194/setup-of-two-additional-ssd-dri= ves-in-raid-1 > # > # 2) Then move the postgres pg_xlog dir > # sudo /etc/init.d/postgresql-9.2 stop > # sudo mkdir -p /ssd/pg_xlog > # 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 > > Can you spot something wrong? > > > > Den 30/11/2012 kl. 02.43 skrev Niels Kristian Schj=C3=B8dt > >: > > > Den 30/11/2012 kl. 02.24 skrev "Kevin Grittner" >: > > > >> Niels Kristian Schj=C3=B8dt wrote: > >> > >>> Okay, now I'm done the updating as described above. I did the > >>> postgres.conf changes. I did the kernel changes, i added two > >>> SSD's in a software RAID1 where the pg_xlog is now located - > >>> unfortunately the the picture is still the same :-( > >> > >> You said before that you were seeing high disk wait numbers. Now = it > >> is zero accourding to your disk utilization graph. That sounds li= ke > >> a change to me. > >> > >>> When the database is under "heavy" load, there is almost no > >>> improvement to see in the performance compared to before the > >>> changes. > >> > >> In client-visible response time and throughput, I assume, not > >> resource usage numbers? > >> > >>> A lot of both read and writes takes more than a 1000 times as > >>> long as they usually do, under "lighter" overall load. > >> > >> As an odd coincidence, you showed your max_connections setting to > >> be 1000. > >> > >> http://wiki.postgresql.org/wiki/Number_Of_Database_Connections > >> > >> -Kevin > > > > Hehe, I'm sorry if it somehow was misleading, I just wrote "a lot > of I/O" it was CPU I/O, it also states that in the chart in the link. > > However, as I'm not very familiar with these deep down database > and server things, I had no idea wether a disk bottle neck could > hide in this I/O, so i went along with Shauns great help, that > unfortunately didn't solve my issues. > > Back to the issue: Could it be that it is the fact that I'm using > ubuntus built in software raid to raid my disks, and that it is not > at all capable of handling the throughput? > > > > > > -- > Sent via pgsql-performance mailing list > (pgsql-performance@postgresql.org > ) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance