Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 544A31337BF6 for ; Thu, 17 Mar 2011 22:24:37 -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 19431-09 for ; Fri, 18 Mar 2011 01:24:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gw0-f46.google.com (mail-gw0-f46.google.com [74.125.83.46]) by mail.postgresql.org (Postfix) with ESMTP id 70FFC1337BF8 for ; Thu, 17 Mar 2011 22:24:29 -0300 (ADT) Received: by gwaa18 with SMTP id a18so1372893gwa.19 for ; Thu, 17 Mar 2011 18:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:content-type:content-transfer-encoding :x-mailer:thread-index:content-language; bh=kXsR6y7qLKShwpIl7QSHNRiRyuXfqGOtzsHEzzfGBqY=; b=Lbs/XoYM0BU/59ynRkj8GrGNqo5nctxIFXaCABadYIGBGIdzn8DVqcK52T+5s0Aj5K hQPq0vtXb+e+MMxi6uvzbwlUYK1yez+q0bqQRVAKTR/Dk61+/+g7/bmYPstn/EoYVeLR 49fzH2BDRN1zH2EjrD3OnxExrEwoI7dVktvaw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding:x-mailer :thread-index:content-language; b=tffD4vB0JAKSngWuJf0j3WI6zJDH6RqXlifLMSnXDe56nMaz65Zt2V10/ZAc2o6v74 u8Wz3CThDqelMJ9pP7zreLCcHxCyiD0/CSzit7PyKd8WPcdPhT8UX59gTL4nqeKBLxp+ 0832lCYK5fZu/A3LrD25tM9H0EHkrDzQtE2Pk= Received: by 10.236.181.41 with SMTP id k29mr632272yhm.62.1300411467782; Thu, 17 Mar 2011 18:24:27 -0700 (PDT) Received: from Duality (174-29-69-53.hlrn.qwest.net [174.29.69.53]) by mx.google.com with ESMTPS id h44sm888404yhm.63.2011.03.17.18.24.25 (version=SSLv3 cipher=OTHER); Thu, 17 Mar 2011 18:24:26 -0700 (PDT) From: "mark" To: "'Jeff'" , Cc: "'Brian Ristuccia'" References: In-Reply-To: Subject: Re: Xeon twice the performance of opteron Date: Thu, 17 Mar 2011 19:24:09 -0600 Message-ID: <005e01cbe50b$2f6fad00$8e4f0700$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcvkvngYhUaKFnyWTgSonAQmqo7bfAASRRjA 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: 201103/197 X-Sequence-Number: 42876 > -----Original Message----- > From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance- > owner@postgresql.org] On Behalf Of Jeff > Sent: Thursday, March 17, 2011 9:14 AM > To: pgsql-performance@postgresql.org > Cc: Brian Ristuccia > Subject: [PERFORM] Xeon twice the performance of opteron > > hey folks, > > Running into some odd performance issues between a few of our db > boxes. While trying to speed up a query I ran it on another box and > it was twice as fast. The plans are identical and various portions of > the query run in the same amount of time - it all boils down to most > of the time being spent in a join filter. The plan is as good as it > is going to get but the thing that is concerning me, which hopefully > some folks here may have some insight on, is the very large difference > in runtime. > > three boxes: > A: Intel(R) Xeon(R) CPU E5345 @ 2.33GHz (Runs query > fastest) > 4MB cache > B: Quad-Core AMD Opteron(tm) Processor 2352 (2.1GHZ) (Main > production > box, currently, middle speed) > 512k cache > C: Quad-Core AMD Opteron(tm) Processor 2378 (2.4GHZ) > 512k cache > > A & B are running PG 8.4.2 (yes, I know it desperately need to be > upgraded). C was also on 8.4.2 and since it was not in production I > upgraded it to 8.4.7 and got the same performance as 8.4.2. Dataset > on A & B is the same C is mostly the same, but is missing a couple > weeks of data (but since this query runs over 3 years of data, it is > negligable - plus C runs the slowest!) > > All three running FC10 with kernel Linux db06 > 2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon Feb 23 13:00:23 EST 2009 > x86_64 x86_64 x86_64 GNU/Linux > > Load is very low on each box. The query is running from shared_buffers > - no real IO is occuring. > > The average timing for the query in question is 90ms on A, 180ms on B > and 190ms on C. > > Now here's where some odd stuff starts piling up: explain analyze > overhead on said queries: > 20ms on A, 50ms on B and 85ms on C(!!) > > We had one thought about potential NUMA issues, but doing a series > (100) of connect, query, disconnect and looking at the timings reveals > them all to be solid... but even still we wouldn't expect it to be > that awful. The smaller cache of the opterons is also a valid > argument. > > I know we're running an old kernel, I'm tempted to upgrade to see what > will happen, but at the same time I'm afraid it'll upgrade to a kernel > with a broken [insert major subsystem here] which has happened before. > > Anybody have some insight into this or run into this before? > > btw, little more background on the query: > > -> Nested Loop (cost=5.87..2763.69 rows=9943 width=0) (actual > time=0.571..2 > 74.750 rows=766 loops=1) > Join Filter: (ce.eventdate >= (md.date - '6 days'::interval)) > -> Nested Loop (cost=5.87..1717.98 rows=27 width=8) > (actual time=0.53 > 3..8.301 rows=159 loops=1) > [stuff removed here] > -> Index Scan using xxxxxxx_date_idx on xxxxxx md > (cost=0.00..19.50 rows=1099 width=8) (actual time=0.023..0.729 > rows=951 loops=15 > 9) > Index Cond: (ce.eventdate <= md.date) > > > On all three boxes that inner nestloop completes in about the same > amount of time - it is that join filter that is causing the pain and > agony. (If you are noticing the timing differences, that is because > the numbers above are the actual numbers, not explain analyze). The > query is pulling up a rolling window of events that occured on a > specific date. This query pulls up al the data for a period of time. > ce.eventdate is indexed, and is used in the outer nestloop. Thinking > more about what is going on cache thrashing is certainly a possibility. > > the amazing explain analyze overhead is also very curious - we all > know it adds overhead, but 85ms? Yow. > > -- > Jeff Trout > http://www.stuarthamm.net/ > http://www.dellsmartexitin.com/ I am sure you might have already checked for this, but just incase... Did you verify that no power savings stuff is turned on in the BIOS or at the kernel ? I have to set ours to something HP calls static high performance or something like that if I want boxes that are normally pretty idle to execute in a predictable fashion for sub second queries. I assume you checked with a steam benchmark results on the AMD machines to make sure they are getting in the ballpark of where they are supposed to ?