Debian Swap监控工具
导读:Common Command-Line Tools for Monitoring Swap in Debian free: The most straightforward tool to view memory and swap usa...
Common Command-Line Tools for Monitoring Swap in Debian
- free: The most straightforward tool to view memory and swap usage. Run
free -h
to display totals, used/available space in a human-readable format (e.g., GB/MB). The output includes a dedicated “Swap” line showing key metrics. - top/htop:
- top: A real-time system monitor that shows swap usage in the “KiB Swap” section (total, used, free). It updates dynamically and allows sorting processes by swap usage (press
Shift + M
). - htop: An enhanced version of
top
with a more intuitive interface (color-coded, scrollable). Install viasudo apt install htop
, then runhtop
to view swap stats and process-level details.
- top: A real-time system monitor that shows swap usage in the “KiB Swap” section (total, used, free). It updates dynamically and allows sorting processes by swap usage (press
- vmstat: Reports virtual memory statistics, including swap operations. Use
vmstat -s | grep swap
to get total/used/free swap values, orvmstat 1 5
to refresh stats every second for 5 iterations. - swapon: Manages and displays enabled swap devices/files. Run
sudo swapon --show
to list active swap entries (name, type, size, used space, priority). Combine with-s
(swapon -s
) for a detailed table. - sar: Part of the
sysstat
package (install viasudo apt install sysstat
). Collects historical/system activity data; usesudo sar -r 1 10
to report swap usage every second for 10 iterations (shows “kbmemfree”, “kbbuffers”, “kbcached”, etc.). - /proc/swaps: A virtual file containing real-time swap details. Run
cat /proc/swaps
to see active swap devices/files, their sizes, used space, and priority.
Graphical Tools for Swap Monitoring
- gnome-system-monitor/kde-system-monitor: Built-in GUI tools for monitoring system resources. Install via
sudo apt install gnome-system-monitor
(Debian default) orsudo apt install kde-system-monitor
(KDE users). They provide visual graphs for memory/swap usage and process lists. - conky: A lightweight, customizable desktop widget. Install via
sudo apt install conky
, then configure.conkyrc
to display swap stats (e.g.,Swap: ${ swap} M / ${ swap_total} M
). It runs on the desktop and updates in real time. - netdata: A powerful, web-based monitoring tool. Install via
sudo apt install netdata
, then accesshttp://localhost:19999
in a browser. It provides interactive dashboards for swap usage, memory trends, and process-level metrics.
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: Debian Swap监控工具
本文地址: https://pptw.com/jishu/731064.html