Understanding CPU steal time on EC2 with Munin

I have 4 server stats being monitored at 5-min intervals with Munin

Details are as follows:

  • Server 1: c1.medium
  • Server 2: m1.large
  • Server 3: m1.small
  • Server 4: m1.medium

CPU usage graphed here:

My question are, why is Server 4, the only machine with very much load, have so much “steal” time when there is also so much idle CPU there? As I understand it, steal time only gets triggered when the virtual CPU requests time and it’s not available—so does this mean I have a performance bottleneck going on?

There’s also the chance that Munin out of the box, is not a good stats tool for EC2. If so, please let me know.

Edit: formatting and clarification.


Related discussions:

I managed 100+ servers on aws and had munin on every one. I’d have this issue on random machines. Even 4 machines set up from the same AMI, there was a chance 1 would be like this. I think it could be related to a noisy neighbor, but I’m not sure. It never really hurt us, but there was a few cases where we made sure the new machine wasn’t “noisy” when setting it up.

Yeah I see this in load balanced arrays .. all VMs are processing the same request loads and one of them will have a higher CPU + some steal time. I just assume it’s older hardware / noisy neighbor etc.

There’s also the chance that Munin out of the box, is not a good stats tool for EC2. If so, please let me know.

It’ll work, but Cloudwatch is better in an AWS deployment. Using Munin (or any other traditional server monitoring tool) forces you to view EC2 instances through the same prism as you do servers. EC2 instances are not servers–they’re building blocks that provide computing resources to a larger, loosely-coupled application.

What’s the difference? Traditionally, you’d buy this expensive piece of hardware, spend days configuring it “just right”, documenting all of this in a run book, and then constantly monitor it. If it started to break, you’d get alerted and then go to work fixing it. On AWS, it’s much easier to just kill the offending instance and let the autoscaling group bring a replacement online. It provisions itself via Chef, Puppet, Bash script, etc and then goes back to work.

Individual instances are disposable, monitoring them at a granular level only makes sense when benchmarking. Cloudwatch is more appropriate because it provides a holistic view of your entire application.

I think that just means you have a neighbour which is using their fair share of the CPU you’re running on. More info about steal time:

http://www.axibase.com/cloud/2010/07/22/ec2-monitoring-the-case-of-stolen-cpu/

Solid article. Thanks!

Thanks for the response. It seems this explanation article by thenickdude states that:

By the way, there is an ongo­ing indus­try dis­cus­sion about the ‘stolen cpu’ or ‘steal time’ term. Obvi­ously, the word itself car­ries a con­no­ta­tion that might make some AWS cus­tomers won­der if their fully-paid CPU time was some­how stolen by rogue EC2 instances run­ning on the same phys­i­cal node. Rest assured, the rules of the game are fair. The best way to describe stolen CPU time to your peers is to think of it as shared CPU time belong­ing to other AWS customers.

It is interesting that most people aren’t completely sure how it works. Would be a great article for AWS to write about. (Hope you’re listening @JeffBar)

Regarding Munin, I’ve heard it has scaling issues over a few dozen instances. People recommend Graphite these days though it has more dependencies and is a lot harder to set up. What are you thoughts? Would you set up Munin again going forward?

Thanks Ch0ticGood. You’re right that Cloudwatch is great for the 1000 ft view, I just wish it was prettier and more intuitive. In the EC2 main tab, it doesn’t show you anything about attached EBS instances, on the Cloudwatch tab, clicking on EBS will show you an endless list of volumeids and metricnames so that you have to look each volumeids up to see if its the machine you’re looking for. I would love to see metrics by EC2, EC2 type, or even security group.

Edit: spelling

Good stuff to know.

I’ve heard a lot of good things about Graphite, I’ll probably give it a shot next time around.

The GUI within the AWS management console is a pretty minor piece of Cloudwatch. You could always poll the data you need via the API and represent it any way you wish using other reporting software.

True that. It’s just a whole lot of time and effort. Your reply did make me go out and research it and there are already a few options some people have open sourced!

I am definitely listening!

Let me see if I can dig up some good information on this topic. I can’t say that I fully understand it myself.

Also, a good point to note, Cloudwatch does not provide memory usage information:

It’s up to the operating system to determine show much of a particular memory or storage device is available and how much is not. Since cloud watch can’t access your OS, it can’t see these things. The metrics it does see must be obtained from the hypervisor, which is why it works regardless of which OS you use. – From here

Just today, I had an issue where I noticed there was a memory leak in one of our EC2 apps: http://d.pr/i/IPrL

One could of course, code up custom metrics to output to Cloudwatch but again no, nice dashboard to see all the important stuff in one screen unless you build it custom.

Just today, I had an issue where I noticed there was a memory leak in one of our EC2 apps.

I was dealing with a similar issue on an application a couple of days ago. You might find this recent announcement helpful.

Amazing! Thanks so much!