logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> How-to's & Documentation & Tips View previous topic :: View next topic
Reply to topic   Topic: Impact of name resolution on mysql_connect perfomance
Author
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Thu 04 Aug '11 20:45    Post subject: Impact of name resolution on mysql_connect perfomance Reply with quote

Found the following:

I spend lot of time profiling popular PHP applications finding where exactly processing time is spent during PHP execution. Few months ago, one thing which caught my attention was performance of mysql_connect API. On my windows test bench, xdebug output showed that one call to mysql_connect was taking 0.31 seconds which is huge. While playing with the API, I noticed that when IP address of the MySQL machine is used instead of the hostname, performance of mysql_connect API is much better.

Read more ... http://www.ksingla.net/2010/06/impact-of-name-resolution-on-mysql_connect-perfomance/

Steffen
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 04 Aug '11 21:42    Post subject: Reply with quote

Well that tutorial doesn't tell everything. If mysql is on the same machine localhost is better than 127.0.0.1 cause on the same machine mysql_connect can use named pipes which is often (not always) faster than a TCP connect. Of cause DNS / name resolution takes a lot of time (same for apache Wink ) If you using mysql over the network LAN or WAN you should try a peristent connection which can be reused.
Back to top


Reply to topic   Topic: Impact of name resolution on mysql_connect perfomance View previous topic :: View next topic
Post new topic   Forum Index -> How-to's & Documentation & Tips