Re: Connecting To Multiple MySQL Databases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Silvio Porcellana wrote:
> Richard Lynch wrote:
>  >
>> <snip />
>  >
>> Actually, you want a few SPARE MySQL connections, so you can use the
>> mysql
>> command line monitor to do things -- Particularly in case of a run-away
>> PHP/MySQL script which slams the server into over-drive...  If you don't
>> have a connection available cuz they're all used up by Apache/_pconnect,
>> you can't log into mysql monitor and you can't use mysqladmin to bring
>> it
>> down nicely and...  Don't do that. :-)
>  >
>> <snip />
>>
> Actually, MySQL already takes care of that as it allows 'max_connections +
> 1' clients to
> connect, leaving the '+1' connection for the user(s) with SUPER privilege
> (that can
> therefore issue a "SHOW PROCESSLIST" or nicely bring down the server).
>
> http://dev.mysql.com/doc/mysql/en/too-many-connections.html

True.

However, there's often somebody with a mysql monitor left open/hanging
tying up a resource, and ...

Actually, to be sure it's clear:

Apache will hold a connection for EACH username/password used to _pconnect.

So if you've got, say, two different username/passwords using _pconnect to
the database, you need twice as many max_connections in /etc/my.cnf as you
have Apache children, plus your spares.

The re-usable _pconnect data structures are tied to username/password to
be sure they don't "leak" data from one username to the other for security
reasons, I think.  And I reckon a lot of the username-based access is
built into the connection structure, so it wouldn't be efficient to scrap
all that and re-build -- It wouldn't be _pconnect any more.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux