ERR
redis
resource_error
ai_generated
true
I/O 线程池耗尽:没有可用线程处理连接
ERR I/O threads pool exhausted: no available thread for connection
ID: redis/io-threads-pool-starvation
80%修复率
82%置信度
1证据数
2023-11-01首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 6.2 | active | — | — | — |
| 7.0 | active | — | — | — |
| 7.2 | active | — | — | — |
根因分析
Redis 的 I/O 线程配置中线程数过少,无法处理当前连接负载,导致线程池耗尽。
English
Redis's I/O threads configuration has too few threads to handle the current connection load, leading to thread pool starvation.
官方文档
https://redis.io/docs/latest/operate/oss_admin/io-threads/解决方案
-
Increase the number of I/O threads in redis.conf: io-threads 8 (adjust based on CPU cores) and restart Redis.
-
Reduce the number of concurrent connections by implementing connection pooling in client applications, e.g., using a pool with max 50 connections per client.
-
Enable I/O thread read/write by setting io-threads-do-reads yes (if not already enabled) to distribute load more evenly.
无效尝试
常见但无效的做法:
-
Increase maxclients to allow more connections.
70% 失败
This does not increase the number of I/O threads; it only allows more connections to queue up, worsening the starvation.
-
Disable I/O threads entirely by setting io-threads to 1.
50% 失败
This removes the thread pool but shifts all I/O to the main thread, potentially causing CPU bottlenecks and higher latency.
-
Restart Redis to clear the thread pool state.
80% 失败
The pool exhaustion is due to configuration and load, not a transient state; restarting only provides temporary relief until the same load returns.