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 EE330D1D2B7 for ; Wed, 21 Apr 2004 08:18:56 -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 14043-04 for ; Wed, 21 Apr 2004 08:18:58 -0300 (ADT) Received: from server.pyrenet.fr (server.pyrenet.fr [194.250.190.1]) by svr1.postgresql.org (Postfix) with ESMTP id CD8E8D1D067 for ; Wed, 21 Apr 2004 08:18:53 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by localhost.pyrenet.fr (Postfix) with ESMTP id 91FE011035; Wed, 21 Apr 2004 13:18:56 +0200 (MET DST) Received: from server.pyrenet.fr ([127.0.0.1]) by localhost (server [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07841-09; Wed, 21 Apr 2004 13:18:53 +0200 (MET DST) Received: from server.pyrenet.fr (server.pyrenet.fr [194.250.190.1]) by server.pyrenet.fr (Postfix) with ESMTP id 0A9ED11034; Wed, 21 Apr 2004 13:18:53 +0200 (MET DST) Date: Wed, 21 Apr 2004 13:18:53 +0200 (MET DST) From: ohp@pyrenet.fr Reply-To: ohp@pyrenet.fr To: Tom Lane Cc: josh@agliodbs.com, Joe Conway , "scott.marlowe" , Bruce Momjian , lutzeb@aeccom.com, pgsql-performance@postgresql.org, Neil Conway Subject: Re: Wierd context-switching issue on Xeon In-Reply-To: <1407.1082419316@sss.pgh.pa.us> Message-ID: References: <40843E63.7050101@joeconway.com> <200404191455.04068.josh@agliodbs.com> <1407.1082419316@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at pyrenet.fr X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200404/341 X-Sequence-Number: 6641 How long is this test supposed to run? I've launched just 1 for testing, the plan seems horrible; the test is cpu bound and hasn't finished yet after 17:02 min of CPU time, dual XEON 2.6G Unixware 713 The machine is a Fujitsu-Siemens TX 200 server On Mon, 19 Apr 2004, Tom Lane wrote: > Date: Mon, 19 Apr 2004 20:01:56 -0400 > From: Tom Lane > To: josh@agliodbs.com > Cc: Joe Conway , scott.marlowe , > Bruce Momjian , lutzeb@aeccom.com, > pgsql-performance@postgresql.org, Neil Conway > Subject: Re: [PERFORM] Wierd context-switching issue on Xeon > > Here is a test case. To set up, run the "test_setup.sql" script once; > then launch two copies of the "test_run.sql" script. (For those of > you with more than two CPUs, see whether you need one per CPU to make > trouble, or whether two test_runs are enough.) Check that you get a > nestloops-with-index-scans plan shown by the EXPLAIN in test_run. > > In isolation, test_run.sql should do essentially no syscalls at all once > it's past the initial ramp-up. On a machine that's functioning per > expectations, multiple copies of test_run show a relatively low rate of > semop() calls --- a few per second, at most --- and maybe a delaying > select() here and there. > > What I actually see on Josh's client's machine is a context swap storm: > "vmstat 1" shows CS rates around 170K/sec. strace'ing the backends > shows a corresponding rate of semop() syscalls, with a few delaying > select()s sprinkled in. top(1) shows system CPU percent of 25-30 > and idle CPU percent of 16-20. > > I haven't bothered to check how long the test_run query takes, but if it > ends while you're still examining the behavior, just start it again. > > Note the test case assumes you've got shared_buffers set to at least > 1000; with smaller values, you may get some I/O syscalls, which will > probably skew the results. > > regards, tom lane > > -- Olivier PRENANT Tel: +33-5-61-50-97-00 (Work) 6, Chemin d'Harraud Turrou +33-5-61-50-97-01 (Fax) 31190 AUTERIVE +33-6-07-63-80-64 (GSM) FRANCE Email: ohp@pyrenet.fr ------------------------------------------------------------------------------ Make your life a dream, make your dream a reality. (St Exupery)