Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A012C1337B67 for ; Tue, 15 Feb 2011 21:00:44 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 82435-03 for ; Wed, 16 Feb 2011 01:00:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id D72B31337B4E for ; Tue, 15 Feb 2011 21:00:36 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PpVkw-0004I7-OW for pgsql-performance@postgresql.org; Wed, 16 Feb 2011 02:00:34 +0100 Received: from cpe-188-129-79-77.dynamic.amis.hr ([188.129.79.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Feb 2011 02:00:34 +0100 Received: from ivoras by cpe-188-129-79-77.dynamic.amis.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Feb 2011 02:00:34 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Ivan Voras Subject: Re: high user cpu, massive SELECTs, no io waiting problem Date: Wed, 16 Feb 2011 02:00:22 +0100 Lines: 56 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpe-188-129-79-77.dynamic.amis.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/402 X-Sequence-Number: 42540 On 15/02/2011 18:19, Thomas P=C3=B6hler wrote: > Hi list, > > first time for me here, hope you=E2=80=99re not dealing too severely wi= th me > regarding guidelines. Giving my best. > > We are running PostgreSQL 8.4.4 on x86_64-unknown-linux-gnu, compiled b= y > GCC gcc (Debian 4.3.2-1.1) 4.3.2, 64-bit on a Supermicro SuperServer > 8026B-6RF. > > This version is downloaded from postgresql.org and selfcompiled, runnin= g > for over a year now. The Server has 128 GB RAM and Four Intel=C2=AE Xeo= n=C2=AE > X7550 with 64 logical cores. So, 64 logical cores total. > Operating System is =E2=80=9CLinux database1 2.6.32-bpo.5-amd64 #1 SMP = Mon Dec > 13 17:10:39 UTC 2010 x86_64 GNU/Linux=E2=80=9D. > > The System boots through iscsi over a Qlogic QLE4062C HBA. Pgdata and > xlog is logged in over iscsi HBA too. We tried en and disabling jumbo > frames. Makes no difference. Are you using 10 Gbit/s Ethernet for iSCSI? Regular 1 Gbit/s Ethernet=20 might be too slow for you. > Since a few weeks we have really strange peaks on this system. User CPU= > is increasing up to 100% and we have lots of SELECTs running. > See ganglia: http://dl.dropbox.com/u/183323/CPUloadprobsdb1.jpg > > Has someone made similar experiences? Perhaps there is some issue > between Postgres 8.4.4 and kernel 2.6.32? From your graph it looks like the number of active processes (I'm=20 assuming they are PostgreSQL processes) is going out of control. There is an old problem (which I've encountered so I'm replying but it=20 may or may not be in your case) in which PostgreSQL starts behaving=20 badly even for SELECT queries if the number of simultaneous queries=20 exceeds the number of logical CPUs. To test this, I'd recommend setting=20 up a utility like pgpool-II (http://pgpool.projects.postgresql.org/) in=20 front of the database to try and limit the number of active connections=20 to nearly 64 (maybe you can have good results with 80 or 100). You might also experiment with pgsql.max_links setting of PHP but IIRC=20 PHP will just refuse more connections than that instead of waiting for=20 them (but maybe your application can spin-wait for them, possibly while=20 also using usleep()).