I recently switched my Heroku app DNS setting from using A record at the apex to using CNAME record at www subdomain, because of the scenario outlined in this blog post: http://neilmiddleton.com/the-dangers-of-a-records-and-heroku/

Supposedly, this is "the right way" to do this. However, since I made the change, I have noticed my response time spiked from about 360ms on average to over 1,000ms.

Pingdom chart: http://stuff.stevepaulo.com/FV74

Is this a natural side effect of using CNAME records? Is there anything I can do to speed this up? Is the danger of using A records a whitchhunt, in which case, I should go back to hard-coded IP Addresses in A records?

  • There is insufficient information in that graph to tell the cause of your problem. A breakdown of what each part of the request cycle contributes to the overall total is the bare minimum. – womble Apr 2 '12 at 22:42
  • And yet, I was able to get useful comments out of other users... – Steve Paulo Apr 3 '12 at 15:53
  • No, you got one general statement out of one other user, with no evidence of applicability to your specific situation. – womble Apr 3 '12 at 19:44

CNAME look ups will require multiple DNS queries, i.e., www.example.com is a CNAME of www.domain.com, so now we look up www.domain.com, etc. It'll depend on the efficiency of your DNS and how many queries you wind up having to do.

Also, looking at the blog post, it should be pointed out that Heroku probably has More Magic than you have, in terms of mitigating DDOS on a particular IP. Heroku having the freedom to change DNS records probably adds very little to their mitigation techniques. You should probably do what Heroku tells you to do in their documentation at https://devcenter.heroku.com/articles/custom-domains.

  • 1
    This should only happen once if your client caches its DNS lookups. I don't know what Pingdom do... – Mark Henderson Apr 2 '12 at 20:50
  • 1
    That's true: it's possible that what the OP is observing is just an artifact of how Pingdom does things. – cjc Apr 2 '12 at 20:52
  • Ah! An interesting thought. I hadn't considered the differences between Pingdom's bot and actual users. – Steve Paulo Apr 2 '12 at 21:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.