Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql_connect or mysql_pconnect?

Status
Not open for further replies.

alphacooler

Programmer
Aug 29, 2005
73
US
I've been reading over at php.net about the difference between persistent connections and a normal msyql_connect. I'm trying to decide which to use. PHP.net mentions using mysql_pconnect if you have a lot of "overhead" in establishing a connection.

I'm not quite sure what this means. Any pointers on how to decide which to use?

Thanks so much.
 
Sorry. Clicked "Submit" instead of "preview".

I depends on your environment.

If your MySQL server sits on the same machine as the web server (common in a lot of installations), persistent connections won't do much of anything for you. Having to establish an IP connection to a foreign (on a different server) causes overhead.

If your MySQL server is used only for your application, persistent connections won't help much. Your MySQL installation will likely have enough "free time" to accept new connections.





Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top