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 C1AB73A4697 for ; Wed, 3 Nov 2004 23:26:03 +0000 (GMT) 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 33013-08 for ; Wed, 3 Nov 2004 23:25:52 +0000 (GMT) Received: from ct.radiology.uiowa.edu (ct.radiology.uiowa.edu [129.255.60.186]) by svr1.postgresql.org (Postfix) with ESMTP id 0C3383A4692 for ; Wed, 3 Nov 2004 23:25:52 +0000 (GMT) Received: from [192.168.1.11] (12-217-241-0.client.mchsi.com [12.217.241.0]) by ct.radiology.uiowa.edu (8.11.6/8.11.6) with ESMTP id iA3NPa303792; Wed, 3 Nov 2004 17:25:36 -0600 Message-ID: <418968E7.40700@johnmeinel.com> Date: Wed, 03 Nov 2004 17:25:27 -0600 From: John A Meinel User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Martin Foster Cc: pgsql-performance@postgresql.org Subject: Re: Restricting Postgres References: <1099509684.4320.2.camel@localhost.localdomain> <41894CD9.8090308@ethereal-realms.org> In-Reply-To: <41894CD9.8090308@ethereal-realms.org> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig92F99F0CDAA06D9B7EFDBEB4" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/32 X-Sequence-Number: 8986 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig92F99F0CDAA06D9B7EFDBEB4 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Martin Foster wrote: > Simon Riggs wrote: > >> On Tue, 2004-11-02 at 23:52, Martin Foster wrote: [...] > I've seen this behavior before when restarting the web server during > heavy loads. Apache goes from zero connections to a solid 120, > causing PostgreSQL to spawn that many children in a short order of time > just to keep up with the demand. > But wouldn't limiting the number of concurrent connections do this at the source. If you tell it that "You can at most have 20 connections" you would never have postgres spawn 120 children. I'm not sure what apache does if it can't get a DB connection, but it seems exactly like what you want. Now, if you expected to have 50 clients that all like to just sit on open connections, you could leave the number of concurrent connections high. But if your only connect is from the webserver, where all of them are designed to be short connections, then leave the max low. The other possibility is having the webserver use connection pooling, so it uses a few long lived connections. But even then, you could limit it to something like 10-20, not 120. John =:-> --------------enig92F99F0CDAA06D9B7EFDBEB4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBiWjrJdeBCYSNAAMRApthAJ4tBFarzA2vq5aQDkBrqOUpUjvthgCgoMGp uBrVH14BtjhKmWVyE3HoR64= =+Jts -----END PGP SIGNATURE----- --------------enig92F99F0CDAA06D9B7EFDBEB4--