One of my sites has recently experienced some downtime due to too many sql connections (25) at any given time. I've upgraded to vps for this 1 site just to make the problem go away but this issue will come up again as traffic continues to grow. I need to knock this one out now so the site is able to sustain growth without more downtime.
The site in question executes about 6 sql requests per page load, which doesn't sound that bad. Each page also scraped information from a few resources so curl+php was working right alongside the sql commands.
Each page took about 8 seconds to load the 1st time, reduction to <2 seconds for future loads after the page was in cache. It's much faster than that now that I'm on my vps ($25/month for 512RAM/20G/200BW ... not bad I say).
I guess my question is how, exactly, do you execute sql commands and get them out of systems resources as quick as possible. I'm not using mysql_pconnect so I understood the sql executed and shut down immediately until the next command was issued. Am I wrong and the mysql connection is open for the entire page loading process? If this is the case I need to work on my page load time vs. trimming the fat on my sql statements.
Thx for any help, I'm a hack at heart and don't know as much as I should about script efficiency.
The site in question executes about 6 sql requests per page load, which doesn't sound that bad. Each page also scraped information from a few resources so curl+php was working right alongside the sql commands.
Each page took about 8 seconds to load the 1st time, reduction to <2 seconds for future loads after the page was in cache. It's much faster than that now that I'm on my vps ($25/month for 512RAM/20G/200BW ... not bad I say).
I guess my question is how, exactly, do you execute sql commands and get them out of systems resources as quick as possible. I'm not using mysql_pconnect so I understood the sql executed and shut down immediately until the next command was issued. Am I wrong and the mysql connection is open for the entire page loading process? If this is the case I need to work on my page load time vs. trimming the fat on my sql statements.
Thx for any help, I'm a hack at heart and don't know as much as I should about script efficiency.