Received: from bush.rutgersinsurance.com (rutgersinsurance.com [38.138.71.194]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB8EeGZ79202 for ; Fri, 8 Dec 2000 09:40:17 -0500 (EST) (envelope-from aalang@rutgersinsurance.com) Received: from 6014cwpza006 ([10.10.10.51]) by bush.rutgersinsurance.com (8.9.3/8.9.3) with SMTP id JAA12352 for ; Fri, 8 Dec 2000 09:45:03 -0500 Message-ID: <002e01c06125$466237a0$330a0a0a@6014cwpza006> From: "Adam Lang" To: References: <3A308CDA.5080009@animated.net.au> Subject: Re: persistant connections? Date: Fri, 8 Dec 2000 09:43:47 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200012/9 X-Sequence-Number: 52 If used correctly, they will save resources on your system and improve performance. To look out for is to make sure they are configured correctly. Following is a previous email involving that topic: From Alexey Borzov Well, there's a problem with PHP's [mis]documentation. First of all, it counts open DB connections not on per-webserver, but on per-process/thread basis. The default PHP config file has the limits of persistent and non-persistent connections set to -1 (no limit)... Setting it to some (supposedly) reasonable value (like, 50) accomplishes nothing: you should multiply 50 by the number of webserver processes/threads. There can be lots of them... :[ And then there comes PHP's "logic": if I can just open the new connection, why bother reusing the old one? And thus Postgres backends start multiplying like rabbits, eventually reaching the limit... :[ You should set a reasonable limit on number of open persistent connections (like 1, maybe 2 or 3), only then PHP will actually reuse them. My webserver now works with such setup and there are no more problems with pg_pconnect(). Adam Lang Systems Engineer Rutgers Casualty Insurance Company http://www.rutgersinsurance.com ----- Original Message ----- From: "Aarmel" To: Sent: Friday, December 08, 2000 2:25 AM Subject: [PHP] persistant connections? > Can people give me a brief pro's and con's for persistant connections? > > Any major problems with them, such as ensureing they are closed for example?