Re: PEAR and MSSQL

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

 



On Wed, August 17, 2005 1:57 am, Chris Boget wrote:
> mssql class.  We are using persistent connections but for some reason

I have NO IDEA if *all* of this applies to MSSQL, however...

If you were talking about MySQL, I'd answer like this:

A "persistent connection" should really be called a "re-usable
connection" from the point of view of PHP.

Because nothing actually "persists" in PHP.

It all "persists" in MySQL.

Now, the way that MySQL "knows" to re-use a connection is:
1. The same username/password is asking for the connection, and
2. The same process is asking for the connection

So, in practice, what happens is, EACH Apache child ends up getting
its own connection, for each database username/password combination
your application uses.

Most simple web applications just have one db username/password, but
you might have more...  Every one of them "counts"

Now, MySQL has a LIMIT on the number of connections it will allow to
exist at any given time.

That LIMIT can be set in /etc/my.cnf

If you have no /etc/my.cnf file, then the LIMIT is the default, and
it's probably smaller than your httpd.conf settings for MaxChildren or
whatever it is.

In fact, you want some *EXTRA* connections laying around, even if the
web server is maxed out an all the possible children are running, each
with their own "persistent" (aka "re-usable") connection.

So if httpd.conf has 250 children, set the number of connections in
/etc/my.cnf to, oh, 260 or so.

Unless you have *TWO* MySQL username/password combinations in use, and
then you need 510 (2 X 250 + 10)

The point being that if your web server is maxed out, you need one
connection per db username per Apache child, plus some spare
connections for things like:
mysqldump (backups)
mysqladmin (shutdown, restart, reload-permissions, etc)
mysql (for REAL MySQL users)

I'm pretty sure almost all of the above applies to MSSQL, except, of
course, that it's not /etc/my.cnf that you have to change to increase
the number of connections allowed. :-)

Presumably there is some kind of silly GUI Windows thingie in the
"Services" or the "MMC" (?) or the "Control Panel" or wherever they've
moved it in the version of Windows you are using this week.  You are
on your own trying to find *THAT*.  Sorry.

HTH

-- 
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