Switching to persistent connections in MySQL is simply a matter of changing the function call from mysql_connect() to mysql_pconnect() - they both take the same parameters, with the difference being that mysql_connect() will always open a new connection, whereas mysql_pconnect() will only open a new connection if there is not one already available. Similarly, the SQLite function sqlite_open() has a persistent counterpart, sqlite_popen().
Author's Note: In the per-process Apache module ("prefork"), persistent resources such as persistent MySQL connections are stored per process, which means if you have 150 Apache children running you'll need 150 MySQL permanent connections - even if some of those processes aren't using MySQL right now.
Copyright 2012 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at