3
votes

This is what the PHP Documentation has to say on Connection Pooling:

The mysqli extension supports persistent database connections, which are a special kind of pooled connections.

and

Every PHP process is using its own Mysqli connection pool.

But do child processes (after a fork()) share the same connection pool?

Therefore, is a permanent database connection avoiding that one child closes another child's connection?

1

1 Answers

0
votes

Read this chapter about mysqli and persistent connections on the official PHP site. Normally a forked child process will share its parents' file-descriptors (which sockets are) so theoretically the answer is yes.

Therefore, is a permanent database connection a solution for the Server has gone away problem?

You will have to try, this error can happen under a variety of circumstances.