Yii and Connection Pool ?

Hi Guys,

I’m wondering how to take advantage of mySQL connection pool with Yii framework ?

Is it possible to have connection pool with Yii database API ? Any idea ?




Php is request-per-page (stateless). You would need to use a stateful language to use connection pool (Java, flex, etc)

Connection pool is used for speeding up the database connection creation, when the application starts up, the bootstrap creates several connections and keep them. When a request needs a connection, instead of creating one on the fly, it goes to the pool and pick one which is available. It saves time and overhead.

You can try to use persistent connections. However, there might be some issues if you are relying on transactions.

Persistent connections != connection pooling.

Please read:


I’m fully aware it’s not the same. But it is a usable alternative.