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 85E1314B2804 for ; Tue, 10 Aug 2004 17:05:11 -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 52260-04 for ; Tue, 10 Aug 2004 20:05:03 +0000 (GMT) Received: from bayswater1.ymogen.net (host-154-240-27-217.pobox.net.uk [217.27.240.154]) by svr1.postgresql.org (Postfix) with ESMTP id 0D2B614B27FF for ; Tue, 10 Aug 2004 17:04:58 -0300 (ADT) Received: by bayswater1.ymogen.net (Postfix, from userid 99) id 765C2A607F; Tue, 10 Aug 2004 21:04:56 +0100 (BST) Received: from 82.68.132.233 (SquirrelMail authenticated user matt@ymogen.net) by webmail.ymogen.com with HTTP; Tue, 10 Aug 2004 21:04:56 +0100 (BST) Message-ID: <4995.82.68.132.233.1092168296.squirrel@webmail.ymogen.com> In-Reply-To: References: <007f01c47d54$233b4bf0$8300a8c0@solent> Date: Tue, 10 Aug 2004 21:04:56 +0100 (BST) Subject: Re: Performance Bottleneck From: matt@ymogen.net To: "Alex Hayward" Cc: "'PostgreSQL Performance'" User-Agent: SquirrelMail/1.4.2-0.1.7.x MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME, PRIORITY_NO_NAME X-Spam-Level: * X-Archive-Number: 200408/128 X-Sequence-Number: 7764 > Squid also takes away the work of doing SSL (presuming you're running it > on a different machine). Unfortunately it doesn't support HTTP/1.1 which > means that most generated pages (those that don't set Content-length) end > up forcing squid to close and then reopen the connection to the web > server. It is true that it doesn't support http/1.1, but 'most generated pages'? Unless they are actually emitted progressively they should have a perfectly good content-length header. > I've also had some problems when Squid had a large number of connections > open (several thousand); though that may have been because of my > half_closed_clients setting. Squid 3 coped a lot better when I tried it > (quite a few months ago now - and using FreeBSD and the special kqueue > system call) but crashed under some (admittedly synthetic) conditions. It runs out of the box with a very conservative setting for max open file descriptors - this may or may not be the cause of the problems you have seen. Certainly I ran squid with >16,000 connections back in 1999... > You still have periods of time when the web servers are busy using their > CPUs to generate HTML rather than waiting for database queries. This is > especially true if you cache a lot of data somewhere on the web servers > themselves (which, in my experience, reduces the database load a great > deal). If you REALLY need to reduce the number of connections (because you > have a large number of web servers doing a lot of computation, say) then > it might still be useful. Aha, a postgres related topic in this thread! What you say is very true, but then given that the connection overhead is so vanishingly small, why not simply run without a persistent DB connection in this case? I would maintain that if your webservers are holding open idle DB connections for so long that it's a problem, then simply close the connections! M