Re: [PHP-DEV] [PHP4] Logging native PHP function calls



You want:

(number of apache children)
X (number of mysql usernames)
====================================================
(number of mysql connections allowed in /etc/my.cnf)

If you really have 150 MaxClients in httpd.conf and 140 mysql
usernames, your /etc/my.cnf should have:
150
X 140
=======
15600

15,600 mysql connections is a LOT of connections, and will take a LOT
of RAM...

But that's the only way to be sure that you don't have connection
problems with that many users, as I understand it.

I've never tried to run a server with 140 mysql usernames, so I could
be wrong...

On Wed, June 13, 2007 2:54 pm, Markus Fischer wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Richard,

thanks for your reply.

Richard Lynch wrote:
Did somebody actually write a mysql_connect as a variable for the
function name? [shudder]

Not me, actually some libraries do.

Otherwise, it seems like you could grep for mysql_connect and
mysql_pconnect and find all the places the connection is made. And
rip them out and replace with an include, while you're at it. :-)

I was at this point. But still I am not 100% sure that I found all
mysql
connections.

You *DO* understand that with _pconnect, you must have:

httpd.conf MaxChildren TIMES number of mysql usernames

I'm not aware of MaxChildren and I couldn't find it in the
documentation, but I know about MaxClients.

We've running two servers, each with MaxClients set to 150. The number
of mysql users is 140.


for your number of connections in /etc/my.cnf

This number is 170 currently.


Actually, you want a few "spare" connections so you can use mysql
command line monitor to connect and to do backups and so on.

That number of connections can rapidly add up to a LOT of RAM if
you've got multiple MySQL usernames...


Actually we've a dedicated hoster which maintains our hardware, but
he's
not able to prevent the "max connections" problems.

Can you explain a bit how you meant you formular? I read it three
times
but I don't understand exactly what math you wanted to tell me
(probably
because I'm not native).

thanks for your time, very appreciated!

- - Markus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGcEtc1nS0RcInK9ARAodyAKDinL9O4ApOblYI8lsNL0HuT1BXgwCeMK5R
1gYWlgZkqJPRmxU+xZEq4qA=
=CkSM
-----END PGP SIGNATURE-----



--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.



Relevant Pages

  • Re: [PHP] "Too many connections" fix?
    ... I meant MaxClients. ... "Nicole" wrote in message ... Because php and mysql are fast to open a regular ... > some other bits I read regarding persistent connections. ...
    (php.general)
  • Re: Experiences with mysql_pconnect?
    ... talk to a MySQL 5.0.45 DB on an Apache 1.3 series server. ... dangling connections to the server at the php.net site. ... especially when the server is remote as it requires multiple calls to MySQL. ... queries that you execute on a regular basis, preparing it and then ...
    (comp.lang.php)
  • Re: Experiences with mysql_pconnect?
    ... talk to a MySQL 5.0.45 DB on an Apache 1.3 series server. ... dangling connections to the server at the php.net site. ... > Using prepared statements will probably speed up your app a lot. ... especially when the server is remote as it requires multiple calls to MySQL. ...
    (comp.lang.php)
  • Re: Reducing load for LAMP app?
    ... MySQL: as much as possible, he keeps query results in RAM, but ... His hoster says that Apache server is under significant load. ... Using apc is pretty much transparent, but memcached will require modifying your database abstraction layer using the memcached functions. ... With persistent connections, you must have the maximum number of connections *ever* required allocated *all of the time* - even if no one is using your server. ...
    (comp.lang.php)
  • Re: Reducing load for LAMP app?
    ... MySQL: as much as possible, he keeps query results in RAM, but ... His hoster says that Apache server is under significant load. ... Using apc is pretty much transparent, but memcached will require modifying your database abstraction layer using the memcached functions. ... With persistent connections, you must have the maximum number of connections *ever* required allocated *all of the time* - even if no one is using your server. ...
    (comp.lang.php)