Skip to content

Instantly share code, notes, and snippets.

@zldrobit
Last active May 22, 2024 03:32
Show Gist options
  • Save zldrobit/0b6dfc054d1e53f356621a1da6472a0b to your computer and use it in GitHub Desktop.
Save zldrobit/0b6dfc054d1e53f356621a1da6472a0b to your computer and use it in GitHub Desktop.

System Performance

Sampling performance as top

perf top --sort comm,dso

Record performance

perf record --call-graph dwarf

Parse performance record

perf report --call-graph --sort comm,dso

See also

https://dev.to/franckpachot/linux-perf-top-basics-understand-the-316l

CPU

7z b -mmt1 (single thread)

7z b5 -mmt1 (5x tests)

7z b (multi thread)

(https://askubuntu.com/a/1219689/958072)

Disk

Throughput

dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

Latency

dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync (https://www.cyberciti.biz/faq/howto-linux-unix-test-disk-performance-with-dd-command/)

sudo fio --name=read_iops --directory=$TEST_DIR --size=10G
--time_based --runtime=5m --ramp_time=2s --ioengine=libaio --direct=1
--verify=0 --bs=4K --iodepth=256 --rw=randread --group_reporting=1
--iodepth_batch_submit=256 --iodepth_batch_complete_max=256

Distinguish rotational from SSD

lsblk -o NAME,ROTA

diskinfo -v DEV for FreeBSD

Memory

https://www.howtogeek.com/devops/how-to-test-your-unix-servers-disk-and-ram-speed/

https://mazzo.li/posts/value-speculation.html

Find virtualization

systemd-detect-virt (https://serverfault.com/a/933994/599382)

virt-what
dmidecode -s system-manufacturer

(https://ostechnix.com/check-linux-system-physical-virtual-machine/)

(Multi) CPU Specification

numactl/numastat, taskset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment