Whoops. Copied over one too few files.
Should be gone now.
'Harm's Way'
Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.
Whoops. Copied over one too few files.
Should be gone now.
You know, I wish I knew more about the internals of MySQL/PHP, to know where the break even point is between closing db connections before a script is over, and reusing just one connection for every query.
I guess it depends on the speed the script runs -- the faster it's done, the more likely keeping one connection open for the whole thing is the efficient choice. But if it takes a long time to run, the bits inbetween where it's not being used, but is just sitting there ... those'll add up.
Which implies that a faster machine works better for keeping them open all script long.
But I could be making shit up.
So, according to your made up shit, would a slow machine be better than a fast one for, um, whatever it is we're trying to have happen?
I think the changes that have just been made are probably the best interim move for this machine. Streamlining the SQL period is best for any machine.
I don't know a whole lot about PHP, but it appears that it has support for persistent SQL connections built in.
PHP: Persistent Database Connections
However, this page gives the cryptic warning:
Warning:
Using persistent connections can require a bit of tuning of your Apache and MySQL configurations to ensure that you do not exceed the number of connections allowed by MySQL.
It doesn't go into details about what exactly those configuration parameters are, and how to tune them.
I'm going to do a little research, and see if I can turn up any information on the matter, or even better, someone who knows something about the subject already.
I think persistent connections are what we don't want. We're being told we have too many open -- not that we're opening too often. So persistent connections would leave us with more open, since we'd lose the respite when a normal connection is closed at the end of the script.
I thought the idea with persistent connections was that we had, say, 50 always open and every task used those 50, instead of opening and closing a connection each time the database is accessed.
I did some more reading, and you're right.
Can you ask your guy if his system is tuned in such a way this would be more efficient for it?
I will pose the question. Hopefully, I'll actually get a response to this question. </pissy bitch>