WP Engine

Solutions
AgencyEnterpriseSmall & Medium BusinessMarketer
How WP Engine supports marketers.Benefits for marketers.Features that help you innovate.
Developer
How WP Engine supports developers.Benefits for developers.Features that help you move faster.
Explore Our Platform
Insights
Thought LeadershipTopics

Read articles, trends, and insights on these topics from leaders in marketing and technology.

Creative AgilityEnterprise PerformanceActionable IntelligenceEcosystem Integration
Resources

Access ebooks, whitepapers, webinars, and other knowledge from our ecosystem of digital experts.
Visit Resource Center.

Delivering a Slam Dunk Experience on WordPressEbook: The Ultimate Guide to WordPress Plugins15 Common WordPress Mistakes Agencies and their Clients Make
Case Studies
About
Our CompanyOur PlatformLatest News

Access the latest news from inside WP Engine.
Visit the Newsroom.

WP Engine Secures Strategic Growth Investment From Silver LakeWP Engine Unveils First WordPress Digital ExperienceWP Engine Expands Global Presence with New Office in Brisbane
Media Center

Get announcements and resources about WP Engine.

Press Releases
Careers at WP Engine
Pricing
Sales Questions?

Contact Sales

Discover why organizations of all types and sizes choose WP Engine — and how it can benefit you.

Chat

1

I'm available right now to answer any of your questions!

Reply

Call

+1-512-201-4819

Contact

Send a message

Compare Plans
Need Support?
Support DocumentationBilling HelpSupport

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to get expert one-on-one help.

Log in for support

Sales Questions

Contact Sales

Discover why organizations of all types and sizes choose WP Engine — and how it can benefit you.

Chat

1

I'm available right now to answer any of your questions!

Reply

Call

+1-512-201-4819

Contact

Send a message

Sign in
Sign in
Search

Search

Compare Plans
Call Sales +1-512-201-4819
Menu
AgencyEnterpriseSmall & Medium BusinessMarketers
How WP Engine supports marketers.Benefits for marketersFeatures that help you innovate.
Developers
How WP Engine supports developers.Benefits for developers.Features that help you move faster.
Our PlatformPricingResource CenterOur CompanySolution CenterThought LeadershipDocumentationCareers

WP Engine DNS Gets an Update

Jason Cohen 5.28.2014

Getting Rid of DNS Timeouts Causing Speed Issues with Outbound Connections

In our continuing efforts to drive faster site performance, we’ve uncovered and already fixed an intermittent issue affecting code that creates outbound connections.

Summary:

  1. Some customers might have found our caching DNS resolution was timing out, which caused outgoing API requests to 3rd-party services either take a long time to complete or fail outright.
  2. Slow DNS resolution caused slow page loads, when the total time of the request exceeded 60 seconds. As a result, 500 errors occured when that connection was forcibly canceled by the platform’s self-healing mechanism.
  3. The fix has already been rolled out on all servers.
  4. Not all servers were affected. However it’s difficult to quantify how many were affected, because the problem was intermittent (i.e. appears and disappears over time and depends on frequency of outbound requests).

See below for an example graph of page-load time for one of our customers before and after this fix. The green area is “time taken for outbound API requests”—that’s the metric this fix addressed. It’s really obvious that the fix was applied at 01:38!

Web Transactions Response Time

For the Curious: Here are the Technical Details

In our investigation into platform performance with a few dozen customer sites, we kept finding slow external API calls to places like api.wordpress.org (where WordPress goes to check whether there are upgrades for core, plugins, and themes) and many other 3rd-party services corresponding to popular plugins and themes.

But the thing is, we know that api.wordpress.org is not slow! It doesn’t make sense that it would be slow to access it from our platform. Furthermore, we would occasionally see something like this:

Trace TimeDo all of these services, two of which are represented by different vendors, take exactly 5 seconds each to complete? No way. Something else was going on.

The problem turned out to be a timeout in our external DNS provider, which was Google DNS.

The reason for the timeout is that Google has policies designed to protect them from DNS-based abuse—DRDoS on port 53 in particular—which has been responsible for several of the largest DDoS attacks that have ever been performed on the internet. Google states that they have policies design to prevent abuse, but isn’t specific about what those policies are or whether a particular user of Google DNS has tripped the “abuse” system.

Regardless, we were tripping the system. Some servers were tripping it almost all the time due to a large volume of requests (we assume), while others tripped it occasionally, depending on volume and on what Google’s abuse algorithms contain.

It is completely reasonable that Google has such counter-measures in their system. Thus, we needed to stop using Google DNS as our primary outbound nameserver system.

The solution is to use data-center-specific internal DNS systems which have no such limits.

Why didn’t we use that system to begin with?

What we found was when the primary failed, sometimes the secondary would fail too, leaving us with no out-going DNS and thus causing failures for our customers.

So we switched to Google DNS, and haven’t had problems in terms of connectivity.

Now we’re putting monitoring in place for various things surrounding DNS, in particular checking once per minute that we can resolve external domains in <100ms rather than getting >1s time and sometimes >5s time as we saw with this problem.

Because of our previous experience with internal DNS, the fix we’re rolling out is a combination platter. We use internal DNS as the primary (and tertiary) services, so that in the 99.9% case DNS is unrestricted and as fast as possible. But then we use Google DNS for the secondary and quaternary servers, so that we fail-over automatically to a service with even higher availability. Because we’re not hitting it all the time, the higher service will not trigger a timeout as often, even in that special case.

Furthermore, we’ve reduced the DNS timeout from 5 seconds (the Linux default) to 1 second. This means we can try all four of the configured DNS servers in less time than our current system was timing-out a single server.

Our new configuration—coupled with monitoring that proactively alerts us whenever a DNS failure or time-out is occurring within 60s of the problem arising—adds even more performance to the DNS component of our platform.

More WordPress news from WP Engine

Finely Tuned Consultant – Kevin LearyOpenSSL Updated to New Security Patch

Comments

  1. Scott Griffiths says

    May 28, 2014 at 5:16 pm

    Really pleased you’ve solved this issue. I was “one of those” customers who had lots if these 500 errors. I’m looking forward to testing my sites out tomorrow. Great work.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Subscribe

    Subscribe to our blog to get great tips for your WordPress site.

  • Favorite Tweets by @wpengine
  • Sign In

    Solutions

    • Agency
    • Enterprise
    • SMB
    • Marketer
    • Developer

    Insights

    • Blog
    • Torque
    • Velocitize

    About

    • Our Company
    • Leadership Team
    • Our Platform
    • Careers
    • Affiliates
    • Contact
    • Legal
    • Newsroom
    • Privacy Policy

    Resources

    • Resource Center
    • Documentation
    • Solution Center
    • Find an Agency

    WP Engine

    504 Lavaca Street, Suite 1000
    Austin, TX 78701

    Sales

    +1-512-201-4819
    [email protected]
    7am–7pm CST

    Billing

    [email protected]

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Instagram
    • RSS
    © 2013—2025 WPEngine, Inc. All rights reserved.
    WP ENGINE®, VELOCITIZE®, TORQUE®, EVERCACHE®, and the cog logo service marks are owned by WPEngine, Inc.