views:

334

answers:

1

I have 10 application servers and 1 mysql database. I would like to do connection pooling for mysql, but simply enabling mysql_pconnect() will not work since it'll cause some servers to have more connections than others.

What's the best solution for this scenario..?

+1  A: 

Why do you want to use persistent connections?

They are likely to cause trouble and will not improve performance noticeably (in all likelihood).

Run some performance tests on production-grade hardware in your lab, and you'll see.

MarkR
When opening thousands of connections over and over, that adds a lot of overhead. Persistent connections will make considerable improvements on the mysql server..
Ian
@MarkR is correct, see http://groups.google.com/group/comp.databases.mysql/browse_thread/thread/4ae68befe1b488e7/e843f0b9e59ad710?#e843f0b9e59ad710
Bill Karwin
Ian - do not presume to know how much impact persistent connections makes until you've performance tested on it. We found (when doing production-grade hardware performance measurement) that it made no significant difference.
MarkR