Skip to main content

Posts

Showing posts from March, 2014

What is loadavg (load average) in Linux when you run uptime?

I searched online for answers, but none of them are good enough for me --- most of them says it's equal to running queue, but some observations on an I/O busy NFS server disagree with that. So I checked source code. TLDR;  load average can be considered as a sum of total running processes (the run queue size) and interruptible process over specific time period. This applies to at least version 2.6.x and 3.x (I only checked source code of those two versions) BTW, the uptime command is only read and output the data in /proc/loadavg for load average. (A little bit) Long but official explanation : copied from Linux kernel source code: of v3.14-rc6 /* * Global load-average calculations * * We take a distributed and async approach to calculating the global load-avg * in order to minimize overhead. * * The global load average is an exponentially decaying average of nr_running + * nr_uninterruptible. * * Once every LOAD_FREQ: * * nr_active = 0; * f