MySQL persistent connections and advantages of mysql_pconnect?

Using a persistent connection leaves the connection open after the script has finished executing. Opening and closing connections over and over causes overhead, while small, that will eventually mount up as the number of requests go up.

However, if you read the manual page for mysql_pconnect it states:

  • If PHP and MySQL are on the same server or local network, the connection time may be negligible, in which case there is no advantage to persistent connections.

If this is the case it may not be worth the trouble changing your code.

You can find more detailed information on persistent connections at the same site as above.