Essentially persistent connections theoretically save work by keeping the connections around so they don't have to connect again. The pros are:
- Saves a small amount of time connecting to the database each request.
The cons are:
- Leaves too many idle connections to your database in most cases
- Creates difficult-to-reproduce bugs where the connections have some state associated with them
In 99% of cases, the disadvantages are large.
To fully understand, you must understand the shared-nothing model that PHP uses, and the model that your web server (e.g. Apache) uses to maintain its threads/processes.
Assuming you use just a single connection to the database and you're using a dedicated server with no other applications on, each worker thread/process must maintain a single connection to the database all the time (in principle).
This is often too many as people tune their web servers to high numbers of connections (MaxClients in Apache) and typically have several web servers.
Normally in PHP, connections are made near to the beginning of the page, and held open until finished with or the page exits, when they are all closed.
You haven't said what database you're using, but if it's MySQL, connecting is VERY fast under normal circumstances, so fast that it does not affect performance signficiantly.
If you are at a point where you could possibly require persistent connections, you will have:
- A performance / load test environment with real hardware and load driver(s)
- A scheme for profiling your PHP application
If you don't have at least both of those, don't even consider it.
Mark