[thelist] Connection Inefficiency

Paul Bennett Paul.Bennett at eyede.com
Tue Jan 18 15:50:25 CST 2005

mysql can use persistent connections (if you specify it). This will 
leave connections open unless they are closed explicitly by your script. 
If not, the next connection will automatically loook for open 
connections and use one instead of creating a new one.

Rob Smith wrote:

>Have you ever noticed that on each one of your pages... I don't know, maybe
>you code like this... you have some form of connection string. And if you're
>a good coder, at the end of your pages, you close the connection.
>That's a highly inefficient use of server resources if you ask me. Isn't
>there a cleaver way to detect whether or not a connection to the database is
>open for your session, rather than on each page you open and close it?
>It's probably starring me right in the face,
>Rob Smith
>p.s. scripting language is indifferent here...

Paul Bennett
Web Technologies Developer
Eyede International Limited
Level 1, 5 Bouverie Street
PO Box 31 012
Lower Hutt
Phone     +64 4 939 8764
Fax      +64 4 939 6719

More information about the thelist mailing list