Re: [PHP] mysql pconnect voes

2001-11-29 Thread Jani Mikkonen


>  - can have one process more than one persistent connection ?

I dont quite understand this. What do you mean ? 

>  - how many children of apache do u have in one time ?

Depending on load, around 250-350. Heavily changes between nights and
businesshours and weekends.

>  - php.ini means configuration for each instance of php in memory ?

Thats what i was asking too. Is it per process (Apache process) or per
whole server. Eg. Does php work from shared memory as, is there only
once instance of php per apache process tree.

> by my experience every non-closed connection still persists,  so you can VERY
> FAST RUN OUT OF free conns.

I thought limitting all connections in the php.ini would prevent this
but as it seems, it doesnt.


> We have left this concept (persistent connections) for PHP/Apache solutions
> because of this problem.

Same here, we have converted most of the stuff on our site to servlets
because php doesnt just do what we need in same places.


> --
> jani mikkonen wrote:
> 
> > Im managing a really crowded webservers. We have article system implemented
> > in php and backend db is mysql (not my first choise but hey, it does the
> > job)
> >
> > Few version numbers:
> >
> > PHP: 4.0.6 (Self compiled, w/ gcc in solaris8)
> > Mysql: 3.23.24 (Self compiled, w/ gcc in solaris8, ok, not the latest
> > stable but i dont think this is the real problem)
> > Apache: 1.3.22 (Self compiled w/ no other 3rd party modules besides php)
> >
> > Our code uses pconnects throuout the whole site. Website is ran from 6
> > different sparc solaris boxes and one db box is serving them all. This
> > mysql has connection limit in 750 and all apache servers have following
> > three lines in their php.ini:
> >
> > mysql.allow_persistent=On
> > mysql.max_persistent=50
> > mysql.max_links=70
> >
> > Afaik (mysql.max_links - mysql.max_persistent)  is how many nonpersistent
> > connection i can have (in this case, 20 per server). And i have 50
> > persistent. So, i have 6 servers with 50 persistent connections and
> > all pconnects are to same db with same account so there should be
> > available connections in the pool.
> >
> > BUT. After 5 minutes or less (depending on the time/load) all connections
> > hang because php has  used *all* available connections in mysql server
> > (which is 750). I cant image how this is possible. I have 70 connections
> > per server, 6 servers, thats 420 max connectios, that should leave with
> > with 330 spare ones but now. Everything is used up. Even if i would have
> > 50+70 connections (120*6=720) per server, i would still have 30 spare ...
> >
> > So, only solution for me is to set mysql connection timeouts to really
> > low (20 seconds, when default value is 8 hours). And this leads me to
> > *huge* error logs. For example, i just deleted few months old mysql log
> > which was over 2 gigs.
> >
> > I have few ideas. Are these limits in php, per process or per whole
> > process tree ? Sounds to me that they are per process or pconnect still
> > has really nasty bugs in it.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
-- 
 | ,_,  Jani Mikkonen, bofh and proud of it, +358456700349
 |(O,O)   http://www.mikkonen.org/jani
 |(   )  Pgp public key @ http://www.mikkonen.org/jani/keyh.html
 +-"-"---] Realmendon'tneedspacebars  
 |



msg41391/pgp0.pgp
Description: PGP signature


[PHP] mysql pconnect voes

2001-11-29 Thread jani mikkonen

Im managing a really crowded webservers. We have article system implemented
in php and backend db is mysql (not my first choise but hey, it does the
job)

Few version numbers:

PHP: 4.0.6 (Self compiled, w/ gcc in solaris8)
Mysql: 3.23.24 (Self compiled, w/ gcc in solaris8, ok, not the latest
stable but i dont think this is the real problem)
Apache: 1.3.22 (Self compiled w/ no other 3rd party modules besides php)

Our code uses pconnects throuout the whole site. Website is ran from 6
different sparc solaris boxes and one db box is serving them all. This
mysql has connection limit in 750 and all apache servers have following
three lines in their php.ini:

mysql.allow_persistent=On
mysql.max_persistent=50
mysql.max_links=70

Afaik (mysql.max_links - mysql.max_persistent)  is how many nonpersistent
connection i can have (in this case, 20 per server). And i have 50
persistent. So, i have 6 servers with 50 persistent connections and
all pconnects are to same db with same account so there should be
available connections in the pool.

BUT. After 5 minutes or less (depending on the time/load) all connections
hang because php has  used *all* available connections in mysql server
(which is 750). I cant image how this is possible. I have 70 connections
per server, 6 servers, thats 420 max connectios, that should leave with
with 330 spare ones but now. Everything is used up. Even if i would have
50+70 connections (120*6=720) per server, i would still have 30 spare ...

So, only solution for me is to set mysql connection timeouts to really
low (20 seconds, when default value is 8 hours). And this leads me to
*huge* error logs. For example, i just deleted few months old mysql log
which was over 2 gigs.

I have few ideas. Are these limits in php, per process or per whole
process tree ? Sounds to me that they are per process or pconnect still
has really nasty bugs in it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]