X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 829A89DC9A2 for ; Fri, 10 Feb 2006 06:37:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50179-05 for ; Fri, 10 Feb 2006 06:37:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (serval.logix-tt.com [213.239.221.42]) by postgresql.org (Postfix) with ESMTP id D3AD89DC888 for ; Fri, 10 Feb 2006 06:37:00 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (Mc547.m.pppool.de [89.49.197.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 8994A24400F; Fri, 10 Feb 2006 11:37:06 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id B53A618189FA9; Fri, 10 Feb 2006 11:37:07 +0100 (CET) Message-ID: <43EC6CD3.1020308@logix-tt.com> Date: Fri, 10 Feb 2006 11:37:07 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: James Dey Cc: pgsql-performance@postgresql.org Subject: Re: Basic Database Performance References: <20060210082236.4CF9D443F@ctb-mesg3.saix.net> In-Reply-To: <20060210082236.4CF9D443F@ctb-mesg3.saix.net> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.121 required=5 tests=[AWL=0.121] X-Spam-Score: 0.121 X-Spam-Level: X-Archive-Number: 200602/102 X-Sequence-Number: 17088 Hi, James, James Dey wrote: > Apologies if this is a novice queston, but I think it is a performance > one nevertheless. We are running a prototype of a system running on > PHP/Postgresql on an Intel Xeon 2ghz server, 1GB RAM, 40GB hard drive, > as a test bench. The system will be used for tens of thousands of users, > and at the moment we are testing on a base of around 400 users > concurrently during the day. The first thing that comes into my mind here is "connection pooling / recycling". Try to make shure that connections are reused between http requests. Reopening the connection on every http request will break your system, as the backend startup time is rather high. > During the day, the system is incredibly slow to a point where it is > unusable. The reason we are testing on such as small server is to test > performance under pressure, and my estimation is that spec should handle > thousands of users. Note that amount of data, concurrent users, hardware and speed don't always scale linearly. > The server spikes from 5% usage to 95% up and down. The system is a very > simple e-learning and management system and has not given us any issues > to date, only since we’ve been testing with more users has it done so. > The fact that 400 users doing inserts and queries every few minutes is > very concerning, I would like to know if I could be tweaking some config > settings. You should make shure that you run vacuum / analyze regularly (either autovacuum, or vacuum full at night when you have no users on the system). Use statement logging or other profiling means to isolate the slow queries, and EXPLAIN ANALYZE them to see what goes wrong. Create the needed indices, and drop unneded one. (insert usual performance tuning tips here...) > We are running PG 7.4 on a Debian Sarge server, and will be upgrading to > pg8.0 on a new server, but have some migration issues (that’s for > another list!) Ignore 8.0 and go to 8.1 directly. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org