RE: [PHP] Re: Connection Pooling
| From: | Steven Roussey | Date: | Fri, 21 Jul 2000 22:49:13 +0000 |
| Subject: | RE: [PHP] Re: Connection Pooling | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7643@lists.php.net to get a copy of this message | ||
> > Multiply persistent connections * number of apache processes
> per server *
> > number of web servers in the farm. Only a fraction of the corresponding
> > threads on the MySQL server will actually be needed and doing
> anything. In
> > the mean time they do take up resources.
>
> Each httpd process only has a single persistent connection.
My bad. We connect to multiple MySQL servers for each script. That should be
factored out. My real point is to set the number of persistent connections
lower than the number of running apache processes, since we have many idled
apache processes.
Real quickly, each Apache process is holding a persistent connection. With
30 extra idle processes * 4 web servers = 120 extra MySQL threads. Some
setups have more idling servers and more web servers.
I comes down to how long a connection takes to establish vs. how much of
slowdown it causes MySQL. Not to mention, on Linux it is hard to get more
than 1000 threads running, which means that there is an upper limit to the
number of Apache/PHP processes that can run on the other servers. About 1000
in fact.
I tuned off our persistent connections and our MySQL thread count fell. More
memory for other stuff now I guess. I'm going to see what (if any) effect it
has on various machines load averages.
Anyhow, I've worked through several nights this week, so forgive me if I am
way off base and my thoughts are muddy. I'm in a caffeine haze so I can't
tell. ;)
Sincerely,
Steven Roussey
Network54.com
http://network54.com/?pp=e