How to interpret used_cpu_user metric?

1,389 views
Skip to first unread message

Vitaly Karasik

unread,
Apr 9, 2018, 10:10:42 AM4/9/18
to Redis DB
I'd like to monitor CPU metrics provided by Redis "info" command.
https://redis.io/commands/info says: "used_cpu_user:User CPU consumed by the Redis server".
Let's say I'm getting 1064.07.  Which formula I should use in order to receive %%?

TIA,
Vitaly

Paul Pollack

unread,
Apr 9, 2018, 12:22:48 PM4/9/18
to redi...@googlegroups.com
Hi Vitaly,

The used_cpu_user metric is CPU time accumulated by Redis since the process launched. You can determine the percentage of CPU usage by dividing the delta between two reads of that point by the time elapsed between the sampling. E.g. ((used_cpu_user_1 - used_cpu_user_2) / time_elapsed).

Paul

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

hva...@gmail.com

unread,
Apr 9, 2018, 12:33:27 PM4/9/18
to Redis DB
Compare it against the uptime_in_seconds metric in the "server" section.

Both of these are cumulative numbers.  They accumulate seconds for the entire time the Redis server process is running.  This makes the used_cpu_sys and used_cpu_user figures more useless the longer the process runs.

If your Redis server was idle for long periods of time then suddenly started to consume lots of cpu, the percentage would stay low, falsely indicating the process is not currently consuming much cpu.  If your Redis server was very busy for several minutes after it first started up, then settled down to a low level, the percentage would stay high for several minutes, falsely indicating the process is consuming more cpu than it actually is.

My advice is to not use these numbers to monitor your Redis server process's cpu usage.  Use independent monitoring that measures the usage on a minute-by-minute basis rather than the whole time the process is running.

Vitaly Karasik

unread,
Apr 9, 2018, 1:42:11 PM4/9/18
to Redis DB
Paul,
Thank you for your answer.
I compared result of ((used_cpu_user_1 - used_cpu_user_2) / time_elapsed) with AWS Cloudwatch metric and it seems that in addition I should multiple this delta by 100 in order to get percents.  
Am I right?


On Monday, April 9, 2018 at 7:22:48 PM UTC+3, Paul Pollack wrote:
Hi Vitaly,

The used_cpu_user metric is CPU time accumulated by Redis since the process launched. You can determine the percentage of CPU usage by dividing the delta between two reads of that point by the time elapsed between the sampling. E.g. ((used_cpu_user_1 - used_cpu_user_2) / time_elapsed).

Paul
On Mon, Apr 9, 2018 at 10:07 AM, Vitaly Karasik <linu...@gmail.com> wrote:
I'd like to monitor CPU metrics provided by Redis "info" command.
https://redis.io/commands/info says: "used_cpu_user:User CPU consumed by the Redis server".
Let's say I'm getting 1064.07.  Which formula I should use in order to receive %%?

TIA,
Vitaly

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.

Vitaly Karasik

unread,
Apr 9, 2018, 1:44:50 PM4/9/18
to Redis DB
Thank you!
I'm using AWS Redis service (Elasticache), so I should use either Redis API stuff, or AWS Cloudwatch, I don't have access to Linux metrics.
I prefer to use Redis API because it seems to provide more metrics.
Reply all
Reply to author
Forward
0 new messages