Skip to content

Commit

Permalink
Add NUMA
Browse files Browse the repository at this point in the history
Signed-off-by: Asad Sajjad Ahmed <[email protected]>
  • Loading branch information
asadsa92 committed Nov 1, 2024
1 parent 5f28557 commit a29348e
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions varnishgather
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,90 @@ call_ethtool() {
LOG="$OLDLOG"
}

numactl_run() {
log ""
log "# numactl $@"
log ""
numactl $@ >> $LOG 2>&1
}

call_numactl() {
incr

OLDLOG="$LOG"
LOG="${DIR}/$(item_num)_numactl"
banner "numactl"
numactl_run --hardware
numactl_run --show
LOG="$OLDLOG"
}

numastat_run() {
log ""
log "# numastat $@"
log ""
numastat $@ >> $LOG 2>&1
}

call_numastat() {
incr

OLDLOG="$LOG"
LOG="${DIR}/$(item_num)_numastat"
banner "numastat ($(numastat -V))"
numastat_run -p $PID_CACHEMAIN
numastat_run -m
numastat_run -n
LOG="$OLDLOG"
}

show_numanode_stat() {
log ""
log "# cat /sys/devices/system/node/$1/$2"
log ""
cat /sys/devices/system/node/$1/$2 >> $LOG 2>&1
}

show_numanode() {
incr

OLDLOG="$LOG"
LOG="${DIR}/$(item_num)_numa_$(logname "$1")"
banner "NUMA $1"
show_numanode_stat $1 cpulist
show_numanode_stat $1 distance
show_numanode_stat $1 meminfo
show_numanode_stat $1 numastat
show_numanode_stat $1 vmstat
LOG="$OLDLOG"
}

show_numa_stat() {
log ""
log "# cat /sys/devices/system/node/$1"
log ""
cat /sys/devices/system/node/$1 >> $LOG 2>&1
}

show_numa() {
call_numactl
call_numastat

incr

# https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-devices-node
OLDLOG="$LOG"
LOG="${DIR}/$(item_num)_numa"
banner "Non-uniform memory access (NUMA)"
show_numa_stat possible
show_numa_stat online
LOG="$OLDLOG"

for f in /sys/devices/system/node/node*; do
show_numanode "$(basename $f)"
done
}

coredumpctl_run() {
# list all coredumps on the system for Varnish (last 2 week)
run timeout -s TERM 5 coredumpctl --since=-2w list varnishd cache-main
Expand Down Expand Up @@ -742,6 +826,8 @@ for f in /sys/class/net/*; do
call_ethtool "$(basename $f)"
done

show_numa

run journalctl --since=-1w -u vac.service
run journalctl --since=-1w -u varnish.service
run journalctl --since=-1w -u varnish-agent.service
Expand Down

0 comments on commit a29348e

Please sign in to comment.