Search code examples
amazon-web-servicesamazon-ec2loaduptime

Are reported load averages accurate on AWS EC2 instances?


When calling functions like uptime (bash) or sys_getloadavg (php) on EC2 instances, are the returned values correct for that specific instance, or are they for the entire bare-metal system that my instance resides on?

I've been searching around for an answer on Google, and I've found older posts saying not to trust those values; that CloudWatch should be used instead.

However, I'm starting doubt that's the case; on a freshly spawned Ubuntu instance that has idled for 20 minutes, uptime is reporting:

07:22:23 up 20 min,  1 user,  load average: 0.00, 0.00, 0.00

For my use-case, I don't need features CloudWatch provides - the load averages are just fine. That said, are the reported values trustworthy?


Solution

  • The reported values are for your instance, not the entire host system your instance is running on. Generally speaking, they are reliable indications of your workload.

    Load average should definitely be accurate.

    The forum post refers to a case that occurs particularly on some older instance types as well as the burstable t1 and t2 instances, where your CPU % may not line up between CloudWatch and what the instance sees, because even though you are not really "sharing" resources with neighbors, you're still not allowed to use all of the CPU capacity because either your instance is running on hardware that is faster than the instance type you are paying for, or because you've run into credit-based throttling (on t1 or t2).