Skip to content

Slow Response Times

Your site answers, but too slowly. DownBad doesn’t report a page as slow: once a check runs past the monitor’s time limit, it fails as a timeout. This page shows you how to find which step of loading the page is slow, speed that step up, and see the timeout incident close.

DownBad has no incident for a slow page. A URL monitor (a monitor that asks for a web page) fails for slowness only when the page takes longer than the monitor’s Timeout setting, and then the incident shows the same reason as any other timeout, with the failure type timeout:

Request timeout: timeout of 10000ms exceeded

The number is the monitor’s time limit in milliseconds (thousandths of a second): 10000 is 10 seconds. The same reason also appears when nothing answers at all, so if you haven’t yet checked that your server answers, start with Connection Timed Out, which sends you back here once it finds the page arrives, just slowly.

The monitor’s Timeout is the only threshold. It is the only setting that fails a check for being slow and opens an incident. It is in the monitor’s settings, under General Settings, in seconds. A monitor added when you signed up has no Timeout set and waits 10 seconds. In the monitor editor, a new URL monitor starts at 30. DownBad stops every check at 23 seconds, whatever the setting, so a Timeout above 23 acts as 23.

Your notification profile (the settings that decide which alerts a monitor sends, and where) may also have a Latency SLA Breach rule (an SLA, a service level agreement, is a promised level of service). It sends an alert when checks that pass keep taking longer than its Latency, in milliseconds, for at least its Window, in minutes. It never fails a check and never opens an incident, so it can warn you that a page is getting slower before it starts to time out.

The monitor’s page also charts its response time over the last 24 hours against its usual range, learned from its last 14 days, and marks it N% SLOWER once it has stayed above that range for 15 minutes. That mark never fails a check or opens an incident either, so it can show a page getting slower long before it times out. Response time on a monitor’s page explains the chart.

Where the time goes. Loading a page takes five steps, one after another:

  • DNS lookup: finding your server’s address. DNS (the Domain Name System, the internet’s address book) turns a name such as example.com into that address.
  • Connect: opening a connection to the server.
  • Secure connection: for an address that starts with https://, setting up the encryption. This is TLS (Transport Layer Security, the encryption behind https://). An http:// address skips this step.
  • First byte: waiting while the server builds the page, until the first part of its answer arrives. This is called time to first byte.
  • Download: receiving the rest of the page.

DownBad’s check reads only the first 4 kilobytes of the page (roughly its first 4,000 characters) and then stops, so the download step of a large page slows your visitors far more than it slows DownBad’s check.

A page that is slow for DownBad is almost always slow for everyone. DownBad didn’t open the incident on one check, either: it first checks again from up to three other places in the United States, which wait at most 8 seconds, and it opens the incident only when at least half of the places that answered failed too.

Check from other places first. This needs no commands:

  1. Open KeyCDN’s Performance Test, a tool from KeyCDN, a company that runs a CDN (a network of servers around the world that sits in front of a site and keeps copies of its pages). Enter the monitor’s URL setting (the web address it checks) and press Test. It asks for the page from several places around the world and shows the time each step took there: DNS, Connect, TLS and TTFB (time to first byte).

  2. Read the results:

    • It is slow from everywhere: the page really is slow. Carry on below to find which step.
    • It is fast from everywhere, and DownBad still times out: something may be treating DownBad differently, such as bot protection (a service that turns away visitors it takes for programs). See Troubleshooting False Positives.
    • It is slow only from places far from your server: the distance is the problem. See the server is far away.

This command asks for your page the way DownBad does and prints how long each step took. Run it in a terminal (the window where you type commands: Terminal on a Mac, PowerShell on Windows). It uses curl, a tool that fetches a web page, which comes with macOS and Windows; on Ubuntu or Debian (two common versions of Linux) it is in the curl package. It only reads, and changes nothing.

It sends DownBad’s user agent (the name a program gives a website when it asks for a page), follows up to five redirects (a page sending the visitor on to another address) as DownBad does, and gives up after 23 seconds, the longest a DownBad check waits. Put your monitor’s URL in place of https://example.com/.

Terminal window
curl -sS -L --max-redirs 5 -m 23 -A "DownBad/1.0 (Uptime Monitor; +https://downbad.app/docs/resources/checker/)" -o /dev/null -w "dns %{time_namelookup}\nconnect %{time_connect}\ntls %{time_appconnect}\nfirst byte %{time_starttransfer}\ntotal %{time_total}\nredirects %{num_redirects}\n" https://example.com/
If it works
dns 0.002552
connect 0.017717
tls 0.041588
first byte 0.060493
total 0.060561
redirects 0

Against https://httpbin.org/delay/3, a test page that waits 3 seconds before it answers:

If one step is slow
dns 0.021479
connect 0.048458
tls 0.094121
first byte 3.126242
total 3.126311
redirects 0

Against a test page that waits 30 seconds before it answers, on an http:// address, so tls is 0:

If it times out
curl: (28) Operation timed out after 23010 milliseconds with 0 bytes received
dns 0.000012
connect 0.000352
tls 0.000000
first byte 0.000000
total 23.010372
redirects 0

How to read it. Each number is in seconds, counted from the start, so each one includes the steps before it. Subtract the one before to get the time each step took. In the If one step is slow example:

StepWork it outTime it took
DNS lookupdns0.02 seconds
Connectconnect − dns0.03 seconds
Secure connectiontls − connect0.05 seconds
First bytefirst byte − tls3.03 seconds
Downloadtotal − first byte0.00 seconds

So nearly all of the 3 seconds was spent waiting for the server to build the page. For an http:// address, tls reads 0: take first byte − connect for the first byte step instead.

  • curl: (28) Operation timed out means the page took longer than 23 seconds, so no Timeout setting can let it pass. The step that reads 0 is the one that never finished, along with every step after it. In the example, first byte reads 0: the server took the connection but never started answering.
  • redirects isn’t 0: the page sent curl on to another address, and the times include every address it visited, so the steps can’t be read apart. Run the command again with the address the page ends up at.
  • Run it twice in a row. If the first run is much slower than the second, look at which step got faster. If it was the DNS lookup step, the second run used the DNS answer saved from the first, so the first run shows how long your DNS host took: see your DNS host answers slowly. If it was the first byte step, the site’s program was probably asleep before the first run: see the app was asleep.

Then go to the cause for the step that took longest:

Without a terminal: KeyCDN’s Performance Test shows the DNS, Connect, TLS and TTFB steps from several places. In Google Chrome, its DevTools (the browser’s built-in tools for web developers) show the same steps from your own computer. Open your page and press F12, or Cmd+Option+I on a Mac, as Chrome’s guide to opening DevTools shows. Open the Network tab and reload the page. Select the first request under Name, then open the Timing tab. As Chrome’s guide to the Timing tab explains, DNS Lookup is the DNS step, Initial connection covers connecting and setting up the secure connection, Waiting (TTFB) is the first byte step, and Content Download is the download step.

The causes below run from most to least likely, so start with the first.

Some steps happen in your hosting provider’s dashboard, and some on the server itself, so you need to log in to it: with SSH (a way to open a terminal on another computer), or through the console in your hosting provider’s dashboard.

If someone else runs the site for you, such as a managed hosting company or a web agency, send them the output of the command in Check it yourself and a link to this page. The fix is theirs to make.

This is the likely cause when the first byte step takes most of the time, on every run, even when the site is quiet. The server takes the connection quickly, but the program behind the site, such as WordPress (a popular program for building websites), takes a long time to build the page. Usually it is waiting on its database (the program that stores the site’s content), or on another service it asks while it builds the page.

  1. Find what is slow. A database can list every query (a request for data) that took longer than a time you set: MySQL’s slow query log and PostgreSQL’s log_min_duration_statement setting show how to turn this on, for two common databases. Your hosting provider’s dashboard may also show the slowest pages or queries.

  2. Keep a ready-made copy of the page, so the server doesn’t build it for every visitor. This is called a cache. Your software’s own guide shows how:

  3. Run the command in Check it yourself again. The first byte step should now take well under the monitor’s Timeout. Then follow Confirm DownBad sees the fix.

The server is short of memory or processor time

Section titled “The server is short of memory or processor time”

This is the likely cause when the first byte step, or the secure connection step, is slow on every page and gets worse when the site is busy. It is common on cheap hosting plans, where the server is small or shares its computer with other sites. A busy server can be slow at every step that needs it to work, setting up the secure connection included.

  1. Look at how busy the server has been. Your hosting provider’s dashboard usually shows graphs of its CPU (the processor) and memory. Graphs that sit at their top while the page is slow point to this cause.

  2. Restart the web server or app, which often clears a program stuck on requests. This changes the server: a program run as a system service (a program the server starts by itself and keeps running) needs sudo on Linux, which runs a command as the server’s administrator and asks for your password. The program’s own guide shows how to restart it: systemctl, the command that starts and stops system services on most Linux servers, nginx and Apache.

  3. If the server is busy every day, give it more capacity. Your provider’s guide shows how to move it to a larger size. For example, DigitalOcean (a hosting company) has guides for a server, which it calls a Droplet, and for an app on its App Platform (its service that runs your app without you managing a server), and AWS (Amazon Web Services, Amazon’s cloud hosting) has one for a server. On a shared hosting plan, ask your host about a larger plan.

  4. Run the command in Check it yourself again. Then follow Confirm DownBad sees the fix.

This is the likely cause when the first byte step is slow on the first run, and fast when you run the command again straight away. Some hosting stops a site’s program while nobody is using it, and starts it again on the next visit. That restart is called a cold start. It is common on serverless platforms (hosting that runs your code only when a request arrives, such as AWS Lambda or Google Cloud Run). Between DownBad’s checks, the site can fall asleep again, so DownBad may meet a cold start on every check.

  1. Run the command in Check it yourself twice in a row and compare the first byte steps. A first run much slower than the second points to this cause.

  2. Keep at least one copy of the program running. On both of these platforms it costs extra, as their guides say. Your platform’s guide shows how: AWS Lambda’s provisioned concurrency and Google Cloud Run’s minimum instances. On other hosting, look in its guide for a setting that keeps the app running, or for a plan that doesn’t put it to sleep.

  3. Wait a few minutes, so a sleeping app would have stopped, then run the command again. The first run should now be about as fast as the second. Then follow Confirm DownBad sees the fix.

This is the likely cause when the connect and secure connection steps are both slow, but the first byte step isn’t. Each of those steps waits for a message to reach the server and come back, so they grow with distance. DownBad’s checks come from the United States, so a server on another continent is slow for them on every check. To compare, run the command against https://example.com/, which a CDN serves from near you: if its connect step is much shorter than yours, distance is the likely cause.

  1. Put a CDN in front of the site, so visitors connect to a server near them instead of to yours. Cloudflare’s guide shows how to add a site. A CDN keeps the connect and secure connection steps short, but it doesn’t keep copies of pages by default, so the first byte step still waits on your server. To shorten that too, see step 2 of the page takes a long time to build.

  2. If most of your visitors are in one region, the next time you move the server, choose a data center (the building where a hosting company’s servers run) in that region.

  3. Run the command in Check it yourself again. Then follow Confirm DownBad sees the fix.

This is the likely cause when the DNS lookup step is slow on the first run and fast on a second run straight after it. Your domain is the name you registered, such as example.com, and your DNS host is the company where you manage its DNS records (the entries that tell the internet which server answers for your domain), which is often your registrar (the company you registered the domain with).

The second run is fast because the DNS server your computer asks (usually run by your internet provider) saved the answer from the first run and gives it back without asking your DNS host again. So a first run can show how long your DNS host takes, and a second run can’t. A first run can be fast too, if someone on the same network looked up your domain a short while before.

  1. Run the command in Check it yourself twice in a row, and compare the DNS lookup steps:

    • Slow the first time, fast the second: your DNS host is slow to answer. Carry on with the next step.
    • Slow every time: either your DNS host or the DNS server your own computer asks is slow, and this test can’t tell which. Your DNS host is the slow one if it tells DNS servers to keep its answer only for a few seconds, so every lookup goes back to it. That time is the record’s TTL (time to live), shown beside the record in your DNS host’s settings. If it is under 60 seconds, set it to 300 (five minutes), wait for the old TTL to pass, and run the command twice again. If the TTL is already 60 seconds or more and the lookup is still slow every time, the slow part is the DNS server your computer asks. DownBad’s checks don’t use that server, so it doesn’t explain a DownBad timeout. Go back to Check it yourself and look at the other steps.
    • Fast both times: DNS isn’t the slow step.
  2. Move your domain’s DNS to a large DNS host. This doesn’t move your website, only who answers DNS lookups for it. Their guides show how: Cloudflare and Amazon Route 53 (Amazon’s DNS host).

  3. When the move is finished, run the command again, and follow Confirm DownBad sees the fix.

This is the likely cause when the download step takes most of the time. A large page slows your visitors, but DownBad’s check reads only the first 4 kilobytes of a page, so it rarely makes a DownBad check time out. If this is the only slow step and DownBad still times out, look at the first byte step again: it may be slow only some of the time.

  1. Turn on compression (shrinking the page before it is sent). Your software’s guide shows how: nginx’s gzip module, Apache’s mod_deflate (the Apache add-on that compresses pages) and Cloudflare’s compression.

  2. Run the command in Check it yourself again. The download step should be shorter. Then follow Confirm DownBad sees the fix.

This is the likely cause when no step stands out, but the total is close to or above the monitor’s Timeout, and under 23 seconds.

  1. Open the monitor’s settings and find Timeout, under General Settings, in seconds. A monitor added when you signed up has no Timeout set and waits 10 seconds. In the monitor editor, a new URL monitor starts at 30.

  2. Run the command in Check it yourself a few times, at busy and quiet times of day, and note the slowest total.

  3. Set Timeout to about twice that slowest total, so a busier moment doesn’t time out, and save the monitor. DownBad stops every check at 23 seconds, whatever the setting, so a Timeout above 23 acts as 23. The re-checks from other places wait at most 8 seconds.

  4. If the page needs more than 23 seconds, no setting fixes it: make the page faster with the causes above instead.

  5. Then follow Confirm DownBad sees the fix.

  1. Fix the cause first. A check that still fails while you work only adds to the time the incident takes to close.

  2. Open the incident and press Test Now. DownBad checks again within a few seconds instead of waiting for the next scheduled check.

  3. Wait a minute, then reload the incident page, which doesn’t update by itself. The incident closes by itself once enough checks in a row pass. You can’t close an incident by hand.

How many passing checks it takes. While an incident is open, DownBad checks less often after repeated failures. This is called back-off. Each failed check adds one step of back-off, up to 14. Each passing check takes one step away and asks for the next check straight away. When no steps are left, one more passing check closes the incident. So after a steady outage it takes one more passing check than there were failed checks while the incident was open, counting the one that opened it, and never more than 15.

These are the defaults. The monitor’s notification profile can change them for each monitor type under Backoff Config, and its settings are the ones that count: Recovery is how many passing checks in a row, with no back-off left, close the incident (2 by default, counting the check that takes the last step away), and Start after, Rate and Max interval decide when back-off starts and how far it goes. If the profile changes them, the step counts above and the waits below change with them.

How long that takes. After you press Test Now, those passing checks run back to back, a few seconds apart, so the incident usually closes within a minute. It takes longer when checks are slow to finish, such as a page that takes several seconds to load.

If you don’t press Test Now, the first passing check waits for the next scheduled one. With the default settings, from the third failed check on, DownBad waits 5 more minutes for each failure, up to an hour more than the monitor’s usual interval:

Monitor checks everyAfter 1 or 2 failed checksAfter 3After 6After 14 or more
1 minute1 minute6 minutes21 minutes61 minutes
5 minutes5 minutes10 minutes25 minutes65 minutes
1 hour1 hour1 hour 5 minutes1 hour 20 minutes2 hours
1 day1 day1 day 5 minutes1 day 20 minutes1 day 1 hour

Before you ask for help, collect:

  • the link to the incident, and the reason it shows, word for word
  • the output of the command in Check it yourself, run twice in a row, with the time you ran it and your time zone
  • a screenshot of your KeyCDN Performance Test results
  • anything the steps on this page turned up, such as a slow query from the database’s log

Then send all of it to us through Contact Us.