[Techtalk] memory used on ubuntu server
Gayathri Swaminathan
gayathri.swa at gmail.com
Tue Feb 7 02:56:20 UTC 2012
Hiya Anne,
On Mon, Feb 6, 2012 at 2:20 PM, Anne Wainwright <anotheranne at fables.co.za>
wrote:
> Daily inspection of this message caused me to think that all was well.
> On the contrary. The percentage in question is of the RAM plus swap plus
> buffer as investigation with 'free' revealed. It was not the percentage
> of the installed RAM as I imagined.
>
When it comes to verifying actual memory usage, I often trust vmstat
command more than free. The man page is vivid but here are the highlights:
<snip>
[wombat at athena vms]$ vmstat 5 5
procs -----------memory---------- ---swap-- -----io---- --system--
-----cpu-----
r b swpd free buff cache si so bi bo in cs us sy id
wa st
1 3 0 171108 17164 2330504 0 0 6528 6321 886 1259 7 5 44
44 0
1 3 0 168444 17160 2329144 0 0 20892 26430 1155 1933 1 4 13
82 0
0 3 0 197052 17156 2301160 0 0 24147 25630 1288 2122 2 5 9
83 0
0 3 0 194664 17136 2303020 0 0 27137 20673 2043 2803 3 5 12
80 0
0 4 0 203036 17140 2293928 0 0 24962 22437 1645 2099 2 5 16
78 0
</snip>
Under,
procs: you see "r" for running processes, "b" for background or sleeping
processes
Memory: has swpd - Virtual memory usage, free - actual Idle memory, buff -
memory used as buffers, cache - total used in cache
swap: has si - memory swapped in from the disk and so - memory swapped to
the disk
io: has bi - blocks read from disk and bo - blocks written to the disk
system: has in - number of interrupts and cs - number of context switches
cpu: has us - time spent on user activities, sy - time spent by kernel, id
- idle time, wa - io waits
It takes a few tries to read those numbers and interpret them. Also it's
advisable you run this during "peak" windows of system usage ( possibly
cron a job to append output to a file).
Lately I have gotten lazy to just run "sar" on my hosts and review sar data
using kSar to catch something out of the ordinary...
--
Gayathri Swaminathan
gpgkey: 3EFB3D39
Volunteer, FDP
More information about the Techtalk
mailing list