Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my 'dns' lookup and 'connect' take over 2 seconds (57% of page load time)?

enter image description here

I also found that it takes about 2 seconds for the page to display a single thing (I'm assuming its cause its the lookup that is taking the longest) http://www.webpagetest.org/result/120613_QC_833b06d5bbdf38bafcff8ed2777be8ac/

How could I improve this, or get rid of the 2 second lag?

I am hosting this on Heroku, and DNS is setup in GoDaddy.

like image 552
Kamilski81 Avatar asked Jun 14 '12 02:06

Kamilski81


2 Answers

DNS is not your problem.

Take a closer look at your network waterfall chart. Your application.js file is your first performance culprit. If you can:

  • make it smaller
  • if you can, move the script tag to the bottom of the page
  • even better, if you're not doing any document.write's in your script, mark it as "async"

With that out of the way, your background is your next biggest problem - it's massive. Perhaps its worth reconsidering if it should be there if you're really concerned about speed.

like image 112
igrigorik Avatar answered Oct 01 '22 18:10

igrigorik


DNS is slow if the server is heavily loaded, poorly configured, or the network link between the client and DNS server is slow. Try a different server on a bigger network pipe. Your question is missing many details that could provide better answers. For example what is your host and network environment?

like image 27
Gene Avatar answered Oct 01 '22 18:10

Gene