Re: MySQL close connection, what's the purpose?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Time. Opening a db connection is time consuming. There are many levels
involved (making the connection, authentication, etc).. Even worse if
the connection is over tcp/ip because that overhead comes in on top as
well.

Have you timed it?

It would be interesting to actually run a script that opens, retrieves, and inserts data -- let's say 50k times. What's the time difference between one open, 50k retrieves/inserts, and one close-- as compared 50k opens retrieve/insert closes?

Maybe I'll do that tomorrow.

 > You see, my habit stems from doing a lot of communication programming
 -- it was my experience that you open a communication port
 (file/channel/port/whatever); establish a link; exchange data; and
 close it. There's no need to leave it open.

Just because you can close it doesn't mean you have to.

Everyone has their own way.

tedd
--
--------------------------------------------------------------------------------
http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux