Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

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



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

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

BitNami WAMP Stack

Contains ApacheLounge build

Impact of name resolution on mysql_connect perfomance

Post new topic   Reply to topic    Apache Forum Index -> How-to's & Documentation & Tips

View previous topic :: View next topic  
Author Message

Joined: 15 Oct 2005
Posts: 2613
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/

Back to top
James Blond

Joined: 19 Jan 2006
Posts: 6311
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 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

Post new topic   Reply to topic    Apache Forum Index -> How-to's & Documentation & Tips
Page 1 of 1