X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 01F469FB251 for ; Mon, 7 Aug 2006 09:52:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 56279-04 for ; Mon, 7 Aug 2006 12:52:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id CF53E9FB20F for ; Mon, 7 Aug 2006 09:52:18 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k77CqH8g019630; Mon, 7 Aug 2006 08:52:17 -0400 (EDT) To: sumbry@revver.com cc: pgsql-performance@postgresql.org Subject: Re: High Context-Switches on Linux 8.1.4 Server In-reply-to: <44D6EDFA.4030802@revver.com> References: <44D6EDFA.4030802@revver.com> Comments: In-reply-to "Donald C. Sumbry ][" message dated "Mon, 07 Aug 2006 00:38:34 -0700" Date: Mon, 07 Aug 2006 08:52:17 -0400 Message-ID: <19629.1154955137@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/67 X-Sequence-Number: 20252 > We're seeing an average of 30,000 context-switches a sec. This problem > was much worse w/8.0 and got bearable with 8.1 but slowly resurfaced. Is this from LWLock or spinlock contention? strace'ing a few backends could tell the difference: look to see how many select(0,...) you see compared to semop()s. Also, how many of these compared to real work (such as read/write calls)? Do you have any long-running transactions, and if so does shutting them down help? There's been some discussion about thrashing of the pg_subtrans buffers being a problem, and that's mainly a function of the age of the oldest open transaction. regards, tom lane