X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 30DEDD1E0D2 for ; Fri, 20 Feb 2004 18:57:22 +0000 (GMT) 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 96164-02 for ; Fri, 20 Feb 2004 14:57:13 -0400 (AST) Received: from out001.verizon.net (out001pub.verizon.net [206.46.170.140]) by svr1.postgresql.org (Postfix) with ESMTP id 4378DD1E0CD for ; Fri, 20 Feb 2004 14:57:11 -0400 (AST) Received: from spacemonkeylabs.com ([68.161.140.190]) by out001.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20040220185711.EPXI25581.out001.verizon.net@spacemonkeylabs.com>; Fri, 20 Feb 2004 12:57:11 -0600 Message-ID: <40365886.8060508@spacemonkeylabs.com> Date: Fri, 20 Feb 2004 13:57:10 -0500 From: Mitch Pirtle Organization: Spacemonkey Laboratories User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031115 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: jer@highboard.com Cc: pgsql-admin@postgresql.org Subject: Re: PosgreSQL hogging resources? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out001.verizon.net from [68.161.140.190] at Fri, 20 Feb 2004 12:57:11 -0600 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/296 X-Sequence-Number: 12470 Jeremy Smith wrote: >I have newly installed PostgreSQL onto my server, the server's main function >is to serve up a fantasy football site that has a tremendous number of >queries per page. Right now with very low traffic I am seeing a server load >of 2.0+. That got me a little concerned, so I looked at "top" and noticed >that postgres is taking anywhere from 60 - 100 percent of my CPU at any >given time. There are also 116 sleeping processes out of 123. This all >seems very bad, do you guys have any idea what might be causing it or how it >can be addressed? How do I go about cleaning out the sleeping processes? > I agree with Lamar's comments, as well as wondering if it is really needed to run a 'tremendous number of queries' for each page view... Some quick solutions could be to determine if you could: 1) make changes to your design to require fewer hits to the database per page, 2) make a view that provided the information without running so many separate queries, and/or 3) consider using a caching library like ADOdb to limit the number of trips to your database Any combination of these three could significantly reduce the load on your DB box, as well as provide some huge performance gains. How hard is your webserver working? Are they running on the same box? -- Mitch