Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id E38C99FB2B7 for ; Tue, 14 Nov 2006 05:52:08 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 02984-06 for ; Tue, 14 Nov 2006 09:52:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from ebrsrv01.ebravo.it (host53-205-static.34-85-b.business.telecomitalia.it [85.34.205.53]) by postgresql.org (Postfix) with ESMTP id 7419C9FB276 for ; Tue, 14 Nov 2006 05:52:01 -0400 (AST) Received: from [192.168.11.103] ([192.168.11.103]) by ebrsrv01.ebravo.it (8.11.6/8.12.5) with ESMTP id kAE9pl220637; Tue, 14 Nov 2006 10:51:56 +0100 Message-ID: <455991B0.6070209@streppone.it> Date: Tue, 14 Nov 2006 10:51:44 +0100 From: Cosimo Streppone User-Agent: Mozilla Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: Richard Huxton CC: Postgresql Performance list Subject: Re: Context switch storm References: <454B3B75.6@archonet.com> <454B3EDC.3090502@streppone.it> <454B4438.9080105@archonet.com> In-Reply-To: <454B4438.9080105@archonet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/99 X-Sequence-Number: 21869 Richard Huxton wrote: > Cosimo Streppone wrote: >> Richard Huxton wrote: >> >>>> The average context switching for this server as vmstat shows is 1 >>>> but when the problem occurs it goes to 250000. >>> >> I seem to have the same exact behaviour for an OLTP-loaded 8.0.1 server > > upgrade from 8.0.1 - the most recent is 8.0.9 iirc > [...] > Are you seeing a jump in context-switching in top? You'll know when you > do - it's a *large* jump. That's the key diagnosis. Otherwise it might > simply be your configuration settings aren't ideal for that workload. > Sorry for the delay. I have logged vmstat results for the last 3 days. Max context switches figure is 20500. If I understand correctly, this does not mean a "storm", but only that the 2 Xeons are overloaded. Probably, I can do a good thing switching off the HyperThreading. I get something like 12/15 *real* concurrent processes hitting the server. I must say I lowered "shared_buffers" to 8192, as it was before. I tried raising it to 16384, but I can't seem to find a relationship between shared_buffers and performance level for this server. > Well, the client I saw it with just bought a dual-opteron server and > used their quad-Xeon for something else. However, I do remember that 8.1 > seemed better than 7.4 before they switched. Part of that might just > have been better query-planning and other efficiences though. An upgrade to 8.1 is definitely the way to go. Any 8.0 - 8.1 migration advice? Thanks. -- Cosimo