Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B4E4A1337BA3 for ; Wed, 26 Jan 2011 22:35:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 83362-05-5 for ; Thu, 27 Jan 2011 02:35:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f46.google.com (mail-yw0-f46.google.com [209.85.213.46]) by mail.postgresql.org (Postfix) with ESMTP id DC91E1337BCC for ; Wed, 26 Jan 2011 22:35:16 -0400 (AST) Received: by ywe10 with SMTP id 10so399783ywe.19 for ; Wed, 26 Jan 2011 18:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:references:in-reply-to:subject:date :message-id:mime-version:content-type:content-transfer-encoding :x-mailer:thread-index:content-language; bh=mmYU8cqPrvNb+2VuxlHRtAuWE92lk6gh7MsyyP+fz6A=; b=MsZVojWaytHWKFmgv1nxFTOqHEYjwWfI0gxf5cPMV+O5W8McgXc8TwTQ9XSm85ILb/ 6brvlPcLPPbLMlm05iMi1JqCuDOW+B0+QywkMG7aPGwK3NDeEdKlq3Gx4+RD+QrvpZ0n y3IsAgyyWZze8M1nAP0ip6K72CbsdQ/jMNWXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; b=whZBeHOkXoMxDr6Yr14cDWukMCIpjgYQNvjZaBt6tkiPhcNMcj+9cfoFCy3D/+xRZd 4ECQXjBXD519LNYn2QDe9ZbQCJqQvWj8X7Ju6xzh7vTyeYxJFiHwTKb3YgybQp2nEPKT Uc2JOFXVcBYI5ElgR0ZQXovbhD99BynKC+LZQ= Received: by 10.236.111.13 with SMTP id v13mr124340yhg.37.1296095715685; Wed, 26 Jan 2011 18:35:15 -0800 (PST) Received: from Duality (65-101-250-169.hlrn.qwest.net [65.101.250.169]) by mx.google.com with ESMTPS id n63sm1568314yha.20.2011.01.26.18.35.13 (version=SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 18:35:14 -0800 (PST) From: "mark" To: "'Ivan Voras'" , References: <945629628BB0174D86709AFE6D1CDEF5016342E3@SP-EXCHMBC.sp.corp.collab.net> In-Reply-To: Subject: Re: Queries becoming slow under heavy load Date: Wed, 26 Jan 2011 19:34:42 -0700 Message-ID: <01ed01cbbdca$c216aae0$464400a0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acu9XJQgvd79hrWYTk+Um/FixGKjwQAbOaYA Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201101/247 X-Sequence-Number: 42034 > -----Original Message----- > From: pgsql-performance-owner@postgresql.org = [mailto:pgsql-performance- > owner@postgresql.org] On Behalf Of Ivan Voras > Sent: Wednesday, January 26, 2011 6:25 AM > To: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] Queries becoming slow under heavy load >=20 > On 25/01/2011 22:37, Anne Rosset wrote: > > Hi, > > > > We are running some performances tests. With a lot of concurrent > > access, queries get very slow. When there is no load, those queries > run > > fast. >=20 > As others said, you need to stat how many concurrent clients are > working > on the database and also the number of logical CPUs (CPU cores, > hyperthreading) are present in the machine. So far, as a rule of = thumb, > if you have more concurrent active connections (i.e. doing queries, = not > idling), you will experience a sharp decline in performance if this > number exceeds the number of logical CPUs in the machine. >=20 Depending on what version the OP is running - I didn't see where a = version was givin - if there is a "lot" number of idle connections it = can affect things as well. Tom indicated to me this should be "much = better" in 8.4 and later.=20 We cut our idle connections from 600+ to a bit over 300 and saw a good = drop in box load and query responsiveness. (still get large user cpu = load spikes though when a few hundred idle connection processes are = woken open because they all appear to be sleeping on the same semaphore = and one of them has work to do. ) (yeah I know get a pooler, to bad only bouncer seems to pool out idle = connections with transaction pooling but then I lose prepared = statements... I am still working on that part and getting off 8.3. yes = our app tried to do its own quasi connection pooling. When we deployed = the app on a few hundred boxes the error of this choice years ago when = this app lived on much fewer machines is now pretty evident.) >=20 > -- > Sent via pgsql-performance mailing list (pgsql- > performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance