インストール
$ sudo yum -y install htop strace perf iotop pidstat git gcc dstat
- sysdig
- 0x.tools
- pyenv
- visdata
$ pip3 install visidata
テストコード
#include <stdio.h>
#include <sys/time.h>
int main(void)
{
struct timeval tv;
while(1) {
gettimeofday(&tv, NULL);
}
return 1;
}
$ gcc -o gettimeofday gettimeofday.c
for i in {1..6}
do
./gettimeofday &
done
$ sudo vi /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 vdso=0"
GRUB_TIMEOUT=0
GRUB_DISABLE_RECOVERY="true"
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
$ vi ~/.pgpass
localhost:5432:postgres:postgres:postgres
$ chmod 600 ~/.pgpass
$ pgbench -i -s 10 -U postgres -h localhost -d postgres
モニタリング
$ vmstat -w 5
$ dstat 5
$ top -c
f P と WCHAN に移動して d, esc
$ sudo csysdig
$ sudo psn -G syscall,filename,kstack
$ xcapture -o .
$ vd 2020-12-15.15.csv