Skip to content

Instantly share code, notes, and snippets.

@jsl
Last active December 12, 2015 08:29
Show Gist options
  • Save jsl/4744858 to your computer and use it in GitHub Desktop.
Save jsl/4744858 to your computer and use it in GitHub Desktop.
vmstat example
vmstat is a helpful tool for figuring out performance problems on servers.
user@server-prod-db01:~$ vmstat 5
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 10860 51884 41656 3712392 0 0 1297 107 0 0 10 3 84 3
0 0 10860 50388 41668 3713204 0 0 41 446 1409 1173 6 2 91 1
The "b" column shows blocked processes waiting for IO. In this case it's 0, which is a good thing.
"si" and "so" show blocks into and out of swap, again this looks good since both are 0 and we
don't want any swap activity on the db server. Other things to look for are high "cs" counts
(context switches) or lots of input/output activity which can cause the system to be slow.
@jsl
Copy link
Author

jsl commented Feb 9, 2013

Previously this system frequently had positive numbers in "b" (blocked processes), and database tuning fixed this issue. Specifically, we tuned several postgres memory settings and added indexes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment