X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E7653D1EB4C for ; Sat, 1 May 2004 15:51:18 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 57849-10 for ; Sat, 1 May 2004 15:50:59 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 6C268D1B432 for ; Sat, 1 May 2004 15:50:57 -0300 (ADT) Received: (qmail 3372 invoked from network); 1 May 2004 18:50:49 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 1 May 2004 18:50:49 -0000 Subject: Re: Wierd context-switching issue on Xeon From: Dave Cramer Reply-To: pg@fastcrypt.com To: Robert Creager Cc: Josh Berkus , =?ISO-8859-1?Q?Dirk=5FLutzeb=E4ck?= , ohp@pyrenet.fr, Tom Lane , Joe Conway , "scott.marlowe" , Bruce Momjian , pgsql-performance@postgresql.org, Neil Conway In-Reply-To: <20040430220306.15d95162@thunder.mshome.net> References: <200404211029.43675.josh@agliodbs.com> <20040428185753.56614b2c@thunder.mshome.net> <200404291121.51247.josh@agliodbs.com> <20040430220306.15d95162@thunder.mshome.net> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1083437446.25697.109.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sat, 01 May 2004 14:50:47 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/6 X-Sequence-Number: 6837 No, don't go away and be quiet. Keep testing, it may be that under normal operation the context switching goes up but under the conditions that you were seeing the high CS it may not be as bad. As others have mentioned the real solution to this is to rewrite the buffer management so that the lock isn't quite as coarse grained. Dave On Sat, 2004-05-01 at 00:03, Robert Creager wrote: > When grilled further on (Thu, 29 Apr 2004 11:21:51 -0700), > Josh Berkus confessed: > > > spins_per_delay was not beneficial. Instead, try increasing them, one step > > at a time: > > > > (take baseline measurement at 100) > > 250 > > 500 > > 1000 > > 1500 > > 2000 > > 3000 > > 5000 > > > > ... until you find an optimal level. Then report the results to us! > > > > Some results. The patch mentioned is what Dave Cramer posted to the Performance > list on 4/21. > > A Perl script monitored for 120 seconds and generated max and average > values. Unfortunately, I am not present on site, so I cannot physically change > the device under test to increase the db load to where it hit about 10 days ago. > That will have to wait till the 'real' work week on Monday. > > Context switches - avg max > > Default 7.4.1 code : 10665 69470 > Default patch - 10 : 17297 21929 > patch at 100 : 26825 87073 > patch at 1000 : 37580 110849 > > Now granted, the db isn't showing the CS swap problem in a bad way (at all), but > should the numbers be trending the way they are with the patched code? Or will > these numbers potentially change dramatically when I can load up the db? > > And, presuming I can re-produce what I was seeing previously (200K CS/s), you > folks want me to carry on with more testing of the patch and report the results? > Or just go away and be quiet... > > The information is provided from a HP Proliant DL380 G3 with 2x 2.4 GHZ Xenon's > (with HT enabled) 2 GB ram, running 2.4.22-26mdkenterprise kernel, RAID > controller w/128 Mb battery backed cache RAID 1 on 2x 15K RPM drives for WAL > drive, RAID 0+1 on 4x 10K RPM drives for data. The only job this box has is > running this db. > > Cheers, > Rob -- Dave Cramer 519 939 0336 ICQ # 14675561