X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5BDBC9FA68D for ; Mon, 7 Aug 2006 16:24:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 47103-06 for ; Mon, 7 Aug 2006 16:23:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.revver.com (mail.revver.com [207.7.147.37]) by postgresql.org (Postfix) with ESMTP id 6863E9FA2C7 for ; Mon, 7 Aug 2006 16:23:51 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.revver.com (Postfix) with ESMTP id 599FBB5C0B5; Mon, 7 Aug 2006 12:23:50 -0700 (PDT) Received: from mail.revver.com ([127.0.0.1]) by localhost (neil.revver.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26926-06; Mon, 7 Aug 2006 12:23:49 -0700 (PDT) Received: from [192.168.1.11] (c-66-229-34-91.hsd1.ca.comcast.net [66.229.34.91]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.revver.com (Postfix) with ESMTP id DC02FB5C09E; Mon, 7 Aug 2006 12:23:49 -0700 (PDT) Message-ID: <44D7942E.7050406@revver.com> Date: Mon, 07 Aug 2006 12:27:42 -0700 From: "Donald C. Sumbry ][" User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: High Context-Switches on Linux 8.1.4 Server References: <44D6EDFA.4030802@revver.com> <19629.1154955137@sss.pgh.pa.us> <44D7616D.6080906@revver.com> <3795.1154975681@sss.pgh.pa.us> In-Reply-To: <3795.1154975681@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at revver.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.033 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200608/82 X-Sequence-Number: 20267 Tom Lane wrote: > Sorry, I was unclear: it's the age of your oldest transaction that > counts (measured by how many xacts started since it), not how many > cycles it's consumed or not. > With the 8.1 code it's possible for performance to degrade pretty badly > once the age of your oldest transaction exceeds 16K transactions. You > were not specific enough about the behavior of this legacy app to let > me guess where you are on that scale ... Understood. This legacy apps wraps every single transaction (even read only ones) inside of BEGIN; END; blocks. We do about 90+ percent reads to our database, and at 300+ queries a second that could quickly add up. Does this sound like we should investigate this area more? >> Based on the number of semop's we're getting it does look like >> shared_memory may be getting thrased - any suggestions? We did try >> lowering shared_memory usage in half the previous day, > > Unlikely to help --- if it is the pg_subtrans problem, the number of > buffers involved is set by a compile-time constant. Interesting. One other thing to note, this application in particular accounts for only 4 percent of total queries and if we disable the application the database runs like a champ. The only other huge variable I can think of is this app's gratuitous use of cursors. I haven't read too much about Postgres performance especially when dealing with cursors, but could this be a variable? We are considering modifying the app and removing all use of cursors and wonder if we're wasting our time or not. Thanks for the help. -- Sumbry][