408

Request Timeout

The server timed out waiting for the client to finish sending the request.

Quick Definition

The server timed out waiting for the client to finish sending the request. The client did not produce a request within the time the server was prepared to wait. This is different from a 504 Gateway Timeout, which is about the server waiting for an upstream server. A 408 is specifically about the client being too slow to transmit its request.

When It Occurs

A 408 error occurs when the server has a configured timeout for receiving the complete client request, and the client fails to send the full request within that window. The server essentially says "I've been waiting long enough for you to finish your request - I'm closing this connection."

This often happens during large file uploads over slow connections, when a client's network is intermittent, or when idle keep-alive connections expire. Some servers send 408 before closing idle connections to signal they're reclaiming resources.

Common Causes

  • Slow client network connection - The client's internet connection is too slow to transmit the request in time
  • Large file upload on slow connection - Uploading a large file over a connection that can't deliver it fast enough
  • Client-side processing delay - The client is taking too long to prepare and send request data
  • Network interruption during request - Brief network drops or packet loss causing transmission delays
  • Server timeout configured too low - The server's client timeout setting is too aggressive for the expected traffic
  • Proxy/load balancer timeout - An intermediary proxy closes the connection before the request completes
  • Keep-alive connection expired - The server closes an idle keep-alive connection with a 408 status

Platform-Specific Notes:

Nginx Controlled by client_header_timeout (default 60s) and client_body_timeout (default 60s). Increase these for slow clients or large uploads.

Apache Uses Timeout directive (default 60s) and RequestReadTimeout from mod_reqtimeout to control client read timeouts.

Cloudflare Has a 100-second timeout for receiving the complete request from clients. This cannot be changed on free plans.

Node.js Configure via server.requestTimeout (default 300s in Node 18+) or server.headersTimeout.

🛠 How to Fix

  1. Retry the request - 408 errors are often transient; simply retrying usually succeeds
  2. Check your network connection - Ensure you have a stable and reasonably fast internet connection
  3. Reduce request payload size - Compress files or break large uploads into smaller chunks
  4. Increase server timeout settings - Raise client_body_timeout (Nginx) or Timeout (Apache) if legitimate requests are timing out
  5. Use chunked transfer encoding for large uploads - Stream data in chunks to keep the connection active during long uploads
  6. Check proxy/CDN timeout settings - Verify that intermediary proxies and CDNs have appropriate timeout values
  7. Optimize client-side request preparation - Reduce delays between opening the connection and sending the full request

💻 HTTP Example

# Client starts sending a large file upload but is too slow
POST /api/upload HTTP/1.1
Host: example.com
Content-Type: multipart/form-data; boundary=----abc123
Content-Length: 104857600
# ... client sends data slowly, server timeout reached ...

# Server Response (after waiting 60 seconds)
HTTP/1.1 408 Request Timeout
Connection: close
Content-Type: application/json

{
  "error": "Request Timeout",
  "message": "The server timed out waiting for the request to complete",
  "timeout_seconds": 60,
  "statusCode": 408
}

Frequently Asked Questions

Is 408 a server or client problem? +
A 408 Request Timeout is usually a client-side problem. It means the client was too slow sending the complete request to the server. The server waited for the full request but the client didn't deliver it within the allowed time. Common client-side causes include slow network connections, large payloads on poor connections, or client-side processing delays. However, in some cases, an overly aggressive server timeout configuration (set too low) can also be the root cause.
How is 408 different from 504? +
408 Request Timeout means the client was too slow sending the request to the server - the server gave up waiting for the client to finish transmitting the request data. 504 Gateway Timeout means the server (acting as a gateway or proxy) sent the request upstream but the upstream server was too slow responding. In short: 408 = the client was too slow sending, 504 = an upstream server was too slow responding. They occur at different points in the request lifecycle.

Monitor Your Endpoints

Track response times and detect timeout issues across your infrastructure. Get alerts when endpoints become slow or unresponsive.

Start Free Monitoring