Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 38D3DB5DC5A for ; Tue, 11 Oct 2011 03:42:58 -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 23070-02 for ; Tue, 11 Oct 2011 06:42:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by mail.postgresql.org (Postfix) with ESMTP id 79C10B5DC5D for ; Tue, 11 Oct 2011 03:42:48 -0300 (ADT) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0LyDGX-1R0ufq1LJF-015HId; Tue, 11 Oct 2011 08:42:47 +0200 Message-ID: <4E93E562.7080800@2ndQuadrant.com> Date: Tue, 11 Oct 2011 02:42:42 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20111004 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Adding more memory = hugh cpu load References: <4E92F294.9010405@gmail.com> <4E92FB87.1030703@peak6.com> <4E932BFC.7070007@gmail.com> In-Reply-To: <4E932BFC.7070007@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:EVEjHA0PvYkzWD28GqRJZIIPRlLVz4lcAKZZziGg46R FENrj/JdT13JAg9lDglQru3tf8D8OZVCt54uuLwl6cAC+Zem5f 8iqWW8YiAAV6YjxNvtOv8iNrqIPkqVZdB/71/nDgSL2KtLieva lOt64NAaQC3dw+6ChbwLYThZS+uR7lSo/us64LvF6RSCDagpKE YUq0ylqDseF1sHK0XtxiZJ4cbSOiEusU07RDSYHJ2mdU8X9Pk/ aJDmKGoJr4cs+k7zGCP49Vh6lxhY9BXJidUMORCFbcs2woQsbX +Z/yNlMbNYVLdEBj+N8T8gxMKsxalUcj/74mB2xrcCTI6m4Y0A N98Vk5L2xO29Zg8ilWcA= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, TO_NO_BRKTS_PCNT=0.001 X-Spam-Level: X-Archive-Number: 201110/93 X-Sequence-Number: 45315 On 10/10/2011 01:31 PM, alexandre - aldeia digital wrote: > I drop checkpoint_timeout to 1min and turn on log_checkpoint: > > <2011-10-10 14:18:48 BRT >LOG: checkpoint complete: wrote 6885 > buffers (1.1%); 0 transaction log file(s) added, 0 removed, 1 > recycled; write=29.862 s, sync=28.466 s, total=58.651 s > <2011-10-10 14:18:50 BRT >LOG: checkpoint starting: time Sync times that go to 20 seconds suggest there's a serious problem here somewhere. But it would have been better to do these changes one at a time: turn on log_checkpoints, collect some data, then try lowering checkpoint_timeout. A checkpoint every minute is normally a bad idea, so that change may have caused this other issue. > procs -------------------memory------------------ ---swap-- > -----io---- --system-- -----cpu------- > r b swpd free buff cache si so bi > bo in cs us sy id wa st > 34 0 2696 8289288 117852 38432268 0 0 8 > 2757 2502 4148 80 20 0 0 0 > 39 1 2696 8286128 117852 38432348 0 0 24 > 622 2449 4008 80 20 0 0 0 > 41 0 2696 8291100 117852 38433792 0 0 64 > 553 2487 3419 83 17 0 0 0 > ...Notice that we have no idle % in cpu column. You also have no waiting for I/O! This is just plain strange; checkpoint sync time spikes with no I/O waits I've never seen before. System time going to 20% isn't normal either. I don't know what's going on with this server. What I would normally do in this case is use "top -c" to see what processes are taking up so much runtime, and then look at what they are doing with pg_stat_activity. You might see the slow processes in the log files by setting log_min_duration_statement instead. I'd be suspicious of Linux given your situation though. I wonder if increasing the memory is a coincidence, and the real cause is something related to the fact that you had to reboot to install it. You might have switched to a newer kernel in the process too, for example; I'd have to put a kernel bug on the list of suspects with this unusual vmstat output. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us