X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 12F6552943 for ; Tue, 14 Jun 2005 19:36:05 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02706-04 for ; Tue, 14 Jun 2005 22:36:02 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 41E2F52925 for ; Tue, 14 Jun 2005 19:36:01 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DiJvR-0005H9-UL for pgsql-performance@postgresql.org; Wed, 15 Jun 2005 00:30:30 +0200 Received: from simba.summersault.com ([12.161.105.182]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jun 2005 00:30:29 +0200 Received: from mark by simba.summersault.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jun 2005 00:30:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-performance@postgresql.org From: Mark Stosberg Subject: Re: Most effective tuning choices for busy website? Date: Tue, 14 Jun 2005 17:34:52 -0500 Lines: 41 Message-ID: References: <42A3AF2D.4000802@samurai.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: simba.summersault.com User-Agent: KNode/0.8.1 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/325 X-Sequence-Number: 12962 Neil Conway wrote: > Mark Stosberg wrote: >> I've used PQA to analyze my queries and happy overall with how they are >> running. About 55% of the query time is going to variations of the pet >> searching query, which seems like where it should be going. The query is >> frequent and complex. It has already been combed over for appropriate >> indexing. > > It might be worth posting the EXPLAIN ANALYZE and relevant schema > definitions for this query, in case there is additional room for > optimization. > >> Our hardware: Dual 3 Ghz processors 3 GB RAM, running on FreeBSD. > > Disk? > > You are presumably using Xeon processors, right? If so, check the list > archives for information on the infamous "context switching storm" that > causes performance problems for some people using SMP Xeons. I wanted to follow-up to report a positive outcome to tuning this Xeon SMP machine on FreeBSD. We applied the following techniques, and saw the average CPU usage drop by about 25%. - in /etc/sysctl.conf, we set it to use raw RAM for shared memory: kern.ipc.shm_use_phys=1 - We updated our kernel config and postmaster.conf to set shared_buffers to about 8000. - We disabled hyperthreading in the BIOS, which had a label like "Logical Processors? : Disabled". I recall there was tweak my co-worker made that's not on my list. I realize it's not particularly scientific because we changed several things at once...but at least it is working well enough for now. Mark