RE: [PHP-DB] Limiting persistant connections with IIS
| From: | Ed Lazor | Date: | Wed, 11 Aug 2004 17:22:02 +0000 |
| Subject: | RE: [PHP-DB] Limiting persistant connections with IIS | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35658@lists.php.net to get a copy of this message | ||
php.ini
; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1
> -----Original Message-----
> From: srees@nildram.co.uk [mailto:srees@nildram.co.uk]
> Sent: Wednesday, August 11, 2004 8:33 AM
> To: php-db@lists.php.net
> Subject: [PHP-DB] Limiting persistant connections with IIS
>
> I'm running a PHP app on windows 2000 / IIS using unified ODBC to
> connect to MS-SQL. I would like to connect to the database using
> persistant connections but need to limit the total number of
> connections to avoid swamping the database. It seems that a new
> connection is created for every request made to the webserver at
> least for the first few tens of requests - presumably a new php
> thread is being created for each request.
>
> I've tried limiting the maximum connections allowed by IIS for
> the website - but this does not appear to affect the number of PHP
> threads holding persistant connections to the db.
> I have set odbc.max_links in the php.ini file in case it is a bug
> in my program opening lots of connections but with maximum connections
> for IIS being set to 20 and max_links 4 I still end up with several
> hundred database connections after a few hundred page requests.
>
> If I was implementing this on apache (which I have much more experience
> of using) I would use the MaxClients directive to achieve this...
>
> Does anyone know how to limit the number of persistant database
> connections on windows/IIS/PHP?
>
> cheer Simon
>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Simon Rees | srees@nildram.co.uk |
> ORA-03113: end-of-file on communication channel
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php