Quote:
|
Originally Posted by Apache Docs
A single control process (the parent) is responsible for launching child processes. Each child process creates a fixed number of server threads as specified in the ThreadsPerChild directive, as well as a listener thread which listens for connections and passes them to a server thread for processing when they arrive.
|
Each child process is going to serve a number of requests in its lifetime. The first time a script executed under that process calls pconnect, that child has a DB connection. You can't assume (since HTTP is fairly stateless) that subsequent requests from the same client will be handled by the same thread or process, but it doesn't matter;if another client requests a script that uses pconnect on the same database with the same credentials, then the connection is already open, saving a bit of time but giving the same result.
As load increases, so do the benefits of pconnect. If you have 10 child processes with 10 server threads each and all threads are serving requests (high load indeed), then you end up with 10 long-lived database connections instead of 100 very short ones. Short being in the range of a fraction of a second, long being the child process's lifetime.