Error Encyclopedia
408

408 Request Timeout Error

Learn what 408 Request Timeout means, why servers time out idle connections, and how to fix slow request issues.

What Does This Error Mean?

The 408 Request Timeout status code means the server did not receive the complete request within its configured timeout period. The client took too long to send the request, or the connection was idle for too long.

Common Causes

1

Slow network connection causing delayed data transmission

2

Large file upload exceeding server timeout limits

3

Server timeout configured too low for normal request patterns

4

Client stalled mid-request due to processing delays

5

Proxy or load balancer timeout shorter than server timeout

How to Fix It

Increase timeout settings

Adjust server timeout configuration to allow more time for requests.

// Nginx proxy timeout settings
proxy_read_timeout 120s;
proxy_connect_timeout 30s;
proxy_send_timeout 120s;

// Express.js timeout
app.timeout = 120000 // 2 minutes

Optimize slow requests

Break large operations into smaller chunks or process them asynchronously.

// Use streaming for large uploads
fetch("/api/upload", {
  method: "POST",
  body: largeFile.stream(), // Stream instead of sending all at once
  headers: { "Content-Type": "application/octet-stream" }
})

Check client timeout

Ensure the client timeout is longer than the server timeout.

// Fetch with custom timeout
const controller = new AbortController()
const timeout = setTimeout(() => controller.abort(), 60000) // 60s
fetch("/api/data", { signal: controller.signal })

Related Tools

Use these tools to debug and fix this error:

Related Errors

Other common errors in this category: