# Redis client: Error: Command timed out / redis.exceptions.TimeoutError: Timeout reading from socket

**Code:** `Redis command timed out / ETIMEDOUT / Command timed out` · **Category:** Redis · **Seen on:** Redis, Java, Python

The client waited longer than its timeout for a Redis reply.

## Meaning

Either Redis is slow/blocked (slow commands, persistence fork, CPU, swap) or the network is lossy. Check `SLOWLOG`, `INFO commandstats`, latency (`redis-cli --latency`), and server load. Tune client timeouts, avoid blocking calls without timeouts, and reduce huge payloads.

## Common causes

- Slow commands blocking the server
- Network latency/packet loss
- Server overloaded or swapping
- Timeout set too low
- Large values or big pipelines

## Quick fix

1. `redis-cli --latency -h HOST` to measure
2. Inspect `SLOWLOG GET` and server load
3. Raise client timeouts moderately; break up large operations

## Detailed fix by platform

### Linux

1. `redis-cli --latency -h HOST; redis-cli SLOWLOG GET 5`

## How to diagnose

1. **Latency** — Measured?
2. **Server** — Blocked/slow?
3. **Timeout** — Appropriate?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/redis/redis-client-timeout-waiting-for-response)
