[Possible Bug]: CPU Metrics when multiple IO Threads
Preconditions (Any important steps we need to know) in redis.conf
io-threads X (where X != 1) io-threads-do-reads yes
Steps to reproduce (How to reproduce what you found step by step) // It depends on the redis node cpu usage (displayed by btop/htop)
Actual behavior (A short description of what you found) When redis-server cpu usage is more than 100% on btop/htop the value in redis insight only reflects up to 100%
Expected behavior (A short description of what you expected to find) Detecting when io-threads are enabled and displaying the CPU output in a format which could be like this %/THREAD_AMOUNT*100
Example: 4 threads 250/400%
Screenshots (Paste or drag-and-drop a screenshot or a link to a recording) // Not really needed
Additional context (Operating system, version of Redis Insight, Redis database version, Redis module version, database type, connection type, logs, or any other information) os: Linux 6.12.48+deb13-amd64 x86_64 redis-server: 8.2.2 redis-insight: 3.0.0
Thanks for reporting this odd issue @PinoOG, I managed to reproduce it. We'll take a deeper look at whether it's actually a bug, and we'll let you know when we have more info and progress on this.
For clarity, here is the Docker setup that I used:
-
docker-compose.yml
version: "3.9"
services:
redis:
image: redis:8.2
container_name: redis-io-threads-test
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf:ro
ports:
- "6379:6379"
networks:
- redis-net
redisinsight:
image: redis/redisinsight:latest
container_name: redisinsight-io-threads-test
depends_on:
- redis
ports:
- "5540:5540"
networks:
- redis-net
# For RedisInsight in Docker, default URL is http://localhost:5540
loadgen:
image: redis:8.2
container_name: redis-loadgen
depends_on:
- redis
networks:
- redis-net
entrypoint: ["/bin/sh", "-c"]
command: >
"sleep 5;
echo 'Starting redis-benchmark load loop...';
while true; do
redis-benchmark -h redis -p 6379 \
-n 10000000 \
-c 500 \
-P 32 \
-t get,set,incr,lpush,rpush,lpop,rpop,sadd,spop,lrange,mset;
done"
networks:
redis-net:
driver: bridge
-
redis.conf
# Basic config
port 6379
bind 0.0.0.0
protected-mode no
# Enable I/O threads
# Choose any value > 1, here we use 4 as in your example
io-threads 4
io-threads-do-reads yes
# Optional: lower logging noise
loglevel notice
# Optional: explicitly disable persistence for faster benchmark
save ""
appendonly no
And I run it via the following commands:
# Start Docker containers for Redis, Redis Insight, and the Benchmark script
docker-compose up --build
# Monitor current CPU usage
docker stats redis-io-threads-test
Thank you! I will wait for your news.