MySQL Persistent Connections
Asked Answered
T

1

3

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..?

Tarragon answered 12/2, 2010 at 14:53 Comment(0)
N
3

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.

Nonlinearity answered 12/2, 2010 at 16:41 Comment(4)
When opening thousands of connections over and over, that adds a lot of overhead. Persistent connections will make considerable improvements on the mysql server..Tarragon
@Nonlinearity is correct, see groups.google.com/group/comp.databases.mysql/browse_thread/…Finedraw
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.Nonlinearity
More info for the debate: mysqlperformanceblog.com/2006/11/12/…Meara

© 2022 - 2024 — McMap. All rights reserved.