I am familiar with several commands like top
, htop
, free
, etc. However, is there a command to see the peak/burst memory usage of the entire server (not individual processes) over, say, the last 30 days/24 hours/etc.?
-
The only solution I am aware of is to use a trending application stack, such as StatsD + Graphite.– jayhendrenCommented Dec 21, 2016 at 20:04
2 Answers
You'll need to collect these metrics.
Sysstat may do this assuming you can define a couple crontabs.
Note that tools such as Munin or Collectd are a couple popular solutions that would allow you to do this (while I wouldn't recommend Statsd/Graphite to newcomers, if at all).
Monitoring solutions such as Cacti, Zabbix, Nagios (with perfdata, such as Icinga or Shinken), or SNMP-based would also allow you to generate graphs from collected metrics.
We could also mention Netdata: even though that one won't keep histories, it's still pretty helpful graphing instantaneous resources usages.
-
3Here's a fairly comprehensive list of metric collections tools. I believe StatsD and collectd are two of the more popular ones. Commented Dec 21, 2016 at 20:06
-
2Thanks, but I'm looking for "a command" (i.e. CLI), not GUI. Is there an equivalent? I'm fine with collecting metrics and saving them, but I just want the data, not all the fluff. Commented Dec 22, 2016 at 18:42
atop
tracks historical metrics and is command line based.
It's packaged in Debian/Ubuntu and Fedora.
-
3It's not obvious how to use this
atop
tool to track memory usage OVER TIME. It just shows a big list of processes and their current memory use. Commented Jan 21, 2023 at 8:09 -
See unix.stackexchange.com/questions/364359/… and unix.stackexchange.com/questions/276069/… for some more useful information on atop. Commented May 1 at 13:17