Re: [PHP-DB] MySQL connection
[email protected] ("Arneson, Joshua") Mon, 6 Mar 2017 00:19:55 +0000
| Newsgroups | php.db |
|---|---|
| Message-ID | <[email protected]> |
Right off the bat, you need to consider concurrency issues. Depending on th= e size of your user base and level of activity this could become a major is= sue. 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 circums= tances) to open the connection, process your transaction , then close the c= onnection.=20 Respectfully, Joshua D. Arneson Data Manager, Mount Sinai NIH Brain & Tissue Repository (NBTR) 130 W Kingsbridge Rd, Rm 5F-04 Bronx, NY 10468 Email: [email protected] Office: 718-584-9000 ext 6094 Mobile: 347-915-8911 Fax: 718-741-4746 > On Mar 5, 2017, at 6:54 PM, Karl DeSaulniers <[email protected]> wrote= : >=20 > Hello everyone, > Long time. Hope all are well. >=20 > Quick question. How should MySQL connections be treated? > Is it ok to leave them open or is it better to close them after transacti= ons? > I have a website that uses sessions and was wondering if there was any si= tuations where I should be closing the connection. > Either for performance reasons or security or best practices.=20 >=20 > Just wondering your professional. >=20 > TIA >=20 > Best, >=20 > Karl DeSaulniers > Design Drumm > https://urldefense.proofpoint.com/v2/url?u=3Dhttp-3A__designdrumm.com&d= =3DDwIFAg&c=3DshNJtf5dKgNcPZ6Yh64b-A&r=3DHSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBk= Q0VGj7tYk&m=3D09oI7Bn2rpePGXSl8CmHMTUqhm3Rjh676OnMYed0L_4&s=3DJBoK9bslzQegA= xQDG_NbsuvcCBLw5_LIQkjMpEj4kE8&e=3D <https://urldefense.proofpoint.com/v2/u= rl?u=3Dhttp-3A__designdrumm.com_&d=3DDwIFAg&c=3DshNJtf5dKgNcPZ6Yh64b-A&r=3D= HSbgyt8GFSyWQ53Nxworjip-dgIKnMlPBkQ0VGj7tYk&m=3D09oI7Bn2rpePGXSl8CmHMTUqhm3= Rjh676OnMYed0L_4&s=3Du_sgRk_DWdl5PZZinSHklw5DuV7oz5cv7MWZCJDsJzA&e=3D > >=20 >=20 >=20 >=20