Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeS4n-0000yQ-D8 for pgsql-performance@arkaria.postgresql.org; Fri, 30 Nov 2012 15:00:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TeS4m-0002FF-TU for pgsql-performance@arkaria.postgresql.org; Fri, 30 Nov 2012 15:00:24 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeS4l-0002EG-Cu for pgsql-performance@postgresql.org; Fri, 30 Nov 2012 15:00:23 +0000 Received: from smtp2.peak6.com ([38.98.137.9]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeS4i-0002Xv-HP for pgsql-performance@postgresql.org; Fri, 30 Nov 2012 15:00:23 +0000 X-AuditID: 0a02cb20-b7f1a6d00000797a-1c-50b8ca02e539 Received: from sswchi5pcas2.peak6.net (sswchi5pcas2.peak6.net [10.100.13.24]) by smtp2.peak6.com (Symantec Messaging Gateway) with SMTP id 26.D2.31098.20AC8B05; Fri, 30 Nov 2012 09:00:19 -0600 (CST) Received: from [10.10.201.64] (10.10.201.64) by sswchi5pcas2.peak6.net (10.100.13.25) with Microsoft SMTP Server (TLS) id 14.2.247.3; Fri, 30 Nov 2012 09:00:18 -0600 Message-ID: <50B8CA01.5040405@optionshouse.com> Date: Fri, 30 Nov 2012 09:00:17 -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> <50B8BC7F.4000005@optionshouse.com> <5F52712E-C339-4DF2-9EE5-A26643CEA2C2@autouncle.com> In-Reply-To: <5F52712E-C339-4DF2-9EE5-A26643CEA2C2@autouncle.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Length: 2260 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCKsWRmVeSWpSXmKPExsXClcIroct8akeAwb8mbouXx+4wWyzddZbF 4vrMc8wWO9ftZXFg8eg8fJ7V43HPGTaPGU9Os3pc2DeNPYAlqoHRJjEvL78ksSRVISW1ONlW yb+gJDM/r9gjv7Q4VcElszg5JzEzN7VISSEzxVbJWEmhICcxOTU3Na/EVimxoCA1L0XJjksB A9gAlWXmKaTmJeenZOal2yp5BvvrWliYWuoaKtnFI4OETpaMxgNv2Qr2CVTsn36cqYHxK08X IyeHhICJRPeuHywQtpjEhXvr2boYuTiEBE4wSkybcRPKWckose7fGiaQKl4BfYlDhyazgtgs AqoSFxYuYgex2QR0JSb1r2ADsYUEVCT6zt4Aq+cXEJbY96GJGcQWFQiTWLPnENQcQYmTM58A bebgEBHwlvjVkgASZhYok5j4+DHYeGEBHYmmTddZIW54yyhx5uNNsDmcAo4SPes72SAabCUu zLnOAmHLSzRvnc0McYOqxIrmiWwQnylI/L/yjmkCo8gsJKtnIWmfhaR9ASPzKkbx4rLE5IxM s4Li3JICI72C1MRsM7281JJNjKCkwHRaYQfj5h6rQ4wCHIxKPLwLFm0PEGJNLCuuzD3EKMHB rCTC+3fjjgAh3pTEyqrUovz4otKc1OJDjD7AMJvILCWanA9MWHkl8YbGpgamlqaGpuamhkY4 hJXEeUNDFwUICaQD0092ampBahHMOCYOTqkGxs1H/TefUqi+PnV5xkJT3d63nzOfXu8om8b6 j/FE3Z1rjJemlTv9Xsy89wHnA4ljzap6lUXnzhuk8PoG5M0v4V+XMeuzyfQQrzvTuo52Ztjs ePBtUsCKePnKjvMv9wkmXPWd277tz0PhO1OW3mPvOfRun5f1z9fbS1m2+N7puyZycsql+S1p z3KUWIozEg21mIuKEwH7oWPFNwMAAA== X-Pg-Spam-Score: -1.9 (-) 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/30/2012 08:48 AM, Niels Kristian Schj=F8dt wrote: > I forgot to run 'sudo mount -a' I feel so embarrassed now :-( - In > other words no the drive was not mounted to the /ssd dir. Yeah, that'll get ya. > I still see a lot of CPU I/O when doing a lot of writes, so the > question is, what's next. Should I try and go' for the connection > pooling thing or monitor that > /var/lib/postgresql/9.2/main/base/pgsql_tmp dir (and what exactly do > you mean by monitor - size?) Well, like Keven said, if you have more than a couple dozen connections on your hardware, you're losing TPS. It's probably a good idea to install pgbouncer or pgpool and let your clients connect to those instead. You should see a good performance boost from that. But what concerns me is that your previous CPU charts showed a lot of iowait. Even with the SSD taking some of the load off your write stream, something else is going on, there. That's why you need to monitor the "size" in MB, or number of files, for the pgsql_tmp directory. That's where PG puts temp files when sorts are too big for your work_mem. If that's getting a ton of activity, that would explain some of your write overhead. > PPS. I talked with New Relic and it turns out there is something > wrong with the disk monitoring tool, so that's why there was nothing > in the disk charts but iostat showed a lot of activity. Yeah. Next time you need to check IO, use iostat. It's not as pretty, but it tells everything. ;) Just to help out with that, use: iostat -dmx That will give you extended information, including the % utilization of your drives. TPS stats are nice, but I was just guessing your drives were stalling out based on experience. Getting an outright percentage is better. You should also use sar. Just a plain: sar 1 100 Will give you a lot of info on what the CPU is doing. You want that %iowait column to be as low as possible. Keep us updated. -- 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