Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

top shows an average CPU usage during peak times of about 20% while CloudWatch monitoring shows an average CPU usage of 40%. What causes this discrepancy?

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

A very good observation and we have run into this as well. Here's what I found -- http://www.metamul.com/blog/measuring-cpu-usage-from-within-ec2-it-doesnt-mean-what-you.html

When you run top within the EC2 instance, it is measuring the CPU usage of the physical core machine that is running your instance and others. This usage is incorrect if you want to be measuring cpu usage of your instance alone (the EC2 compute unit assigned to your instance).

Which is why cloudwatch metrics is real since it is measured external to the instance for the EC2 compute unit(s) assigned to your instance alone.

See here -- https://forums.aws.amazon.com/thread.jspa?threadID=99993

share|improve this answer
    
In other words, they're both right but measuring different things. –  bahamat Aug 22 '12 at 18:39
1  
You could put it that way. However, the OP is concerned that what he thinks he sees is not what amazon says he sees. So, in his case, top data is incorrect for him. But, if you would measure the cpu usage of the underlying core to debug performance issues, it's very useful to run top. If you are concerned only about the usage of your instance, cloudwatch is the way to go. So, yes, they both measure different things. –  Chida Aug 22 '12 at 18:42
1  
I guess I should have followed my statement with "the former is what you think you want, the latter is what you really want", but I thought that had already been covered. –  bahamat Aug 22 '12 at 19:44
    
+1 for what you just said :) –  Chida Aug 22 '12 at 19:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.