Re: [PHP-DB] MySQL connection

2017-03-05 Thread Arneson, Joshua
Right off the bat, you need to consider concurrency issues. Depending on the size of your user base and level of activity this could become a major issue. In the end, why hold an open connection for 15 minutes just to process 20-30 transactions that take 20-30ms each? Just better (under most

[PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
Hello everyone, Long time. Hope all are well. Quick question. How should MySQL connections be treated? Is it ok to leave them open or is it better to close them after transactions? I have a website that uses sessions and was wondering if there was any situations where I should be closing the

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
Ah, thanks for the reply Joshua. Duly noted. So when is it bad to make multiple open and close connections then? I am guessing that could have some impact with lots of users too. Yes? If the website in question does not have a lot of users (less than 1,000), is this still a bad call to keep an

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Arneson, Joshua
If you have multiple calls to the database that are grouped, definitely perform them during the same connection session. The bottom line is unless the overhead associated with opening and closing the connection is going to be an issue programmatically, keep connections brief and group your

Re: [PHP-DB] MySQL connection

2017-03-05 Thread Karl DeSaulniers
That makes complete sense. Thank you Joshua. Best, Karl DeSaulniers Design Drumm http://designdrumm.com > On Mar 5, 2017, at 6:44 PM, Arneson, Joshua wrote: > > If you have multiple calls to the database that are grouped, definitely > perform them during the same