Using persistent and non-persistent connection together in a PHP MySQL app
- by cappuccino
There are parts of my app where a persistent connection is required, in particular the parts where every hour maybe 30,000 select requests are made by many different users, this is causing my mysql server to max out on the 100 connection limit, and i really don't want to increase it since 100 connections already seems like alot. So for the parts of the application where reading and selecting is the case I want to switch to persistent connections.
The other parts where data is being modified is usually done through a transaction, and the general rule is never to use persistent connections for transactions according to the php documentation. So I would like to keep this on non-persistent connections.
My question is, am i able to use persistent and non-persistent connections together in the same app, the same script etc?
I am using PHP 5.2+, MySQL 5+ (InnoDB tables) and the Zend Framework 10.6+