Atop
2024-10-24
Get lowest memfree for given analysis date
atopsar -r /var/log/atop/atop_20240703 -m -R 1 | awk 'NR<7{print $0;next}{print $0| "sort -k 3,4"}' | head -11
atopsar
: atop’s system activity report.-r /var/log/atop/atop_20240703
: Log file to use.-m
: Memory- and swap-occupation-R 1
: Summarize 1 sample into one sample. Log file contains samples of 10 minutes, so this will summarize each sample.-R 6
will summarize one sample per 60 minutes.awk 'NR<7{print $0;next}{print $0| "sort -k 3,4"}'
: For number of input records (NR
) less than7
,print
the input record ($0
), go to thenext
input record and repeat the{print $0}
pattern until the end is reached, then execute the END rule. The END rule in this case is{print $0| "sort -k 3,4"}
, it prints the remaining input records after piping them through the"sort -k 3,4"
command. This avoids sorting the first 7 lines of the atopsar command.head -11
: Get the top 11 lines of output.
Get top 3 memory processes for given analysis date
atopsar -G -r /var/log/atop/atop_20240710