I’m trying to conserve my resources and make my database driven websites as efficient as possible so I don’t bog down the server.
I noticed Dreamhost talks about “Conueries” as 1 connection attempt is equal to 25 queries because of huge number of resources it takes to connect. So I started using mysql_pconnect for persistent connections instead of mysql_connect.
I did not know the difference between the two when I copied and pasted this from a tutorial when I first started learning MySQL.
As I understand it, there is a maximum number of persistent connections allowed, so when the maximum connections are used up if a bunch of people are viewing my site at one time, no one else can view my site? (most of the site depends on the database) If so, what is the maximum persistent connections allowed on Dreamhost?
What is a good strategy or code examples of better connection management if I have to use mysql_connect and make a new connection every time a page loads?