开发者

Using persistent and non-persistent connection together in a PHP MySQL app

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 开发者_如何学Pythona 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+


No, you cannot use persistent and non-persistent connections together in the same script.
And I doubt you really need persistent connection at all.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜