Kamilski81
Kamilski81

Reputation: 15107

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.

Upvotes: 8

Views: 17620

Answers (4)

igrigorik
igrigorik

Reputation: 9601

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.

Upvotes: 4

alexsergeyev
alexsergeyev

Reputation: 535

Webpagetest shows first byte arriving in .3/.4sec, which is way below 2 second lag you're experiencing. I'm not sure you're complaining about your slowness (follow then advice about using Google Public DNS or Open DNS or Dyn Internet Guide, they should help) or your site being slow for everyone else (then read below).

First view DNS lookup time is 52ms according to table at this page.

There are other lookups to things like Google analytics and other externals you opted to use. All of them seem not to be giving you decent resolution time (although I cannot guarantee if webpagetest gives you fair median resolution time or time to recursive server response that uses recursive cache).

Consider doing something about other things that slow you down first:

  • big images that not served at full speed somehow (server may use throttling to prefer serving small files)
  • third party JavaScript that takes awhile to be loaded and processed
  • simplifying Javascript and CSS to minimize action required in browser to render a page and to show something faster than all the resources are loaded.

Upvotes: 0

Madushan
Madushan

Reputation: 7468

If you think your DNS is slow, try Google's for better performance..

And do the test again.

https://developers.google.com/speed/public-dns/

I never did a comparison, but some people say Google DNS is faster than the average. There may be alternatives as well.

Upvotes: 0

Gene
Gene

Reputation: 46960

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?

Upvotes: 1

Related Questions