On FreeBSD systems there are two great commands that are not available on other systems.
These are 'gstat' and 'top -m io' commands, both I/O related.
Often in top/htop there is not much happening but the server is very slow, a lot of the times its because of I/O operations.
The 'gstat' command will tell You (besides other useful statistics) how much the storage devices are loaded:
# gstat
dT: 1.001s w: 1.000s
L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name
1 9679 9614 4807 0.1 63 671 0.2 82.3| ada0
0 0 0 0 0.0 0 0 0.0 0.0| ada0p1
0 65 0 0 0.0 63 671 0.2 1.4| ada0p2
0 0 0 0 0.0 0 0 0.0 0.0| ada0p3
0 0 0 0 0.0 0 0 0.0 0.0| gpt/boot
0 65 0 0 0.0 63 671 0.2 1.5| gpt/sys
0 0 0 0 0.0 0 0 0.0 0.0| gpt/local
0 0 0 0 0.0 0 0 0.0 0.0| zvol/local/SWAP
The 'top -m io' show which processes does how much I/O: # top -m io -o total 10
last pid: 51154; load averages: 0.31, 0.31, 0.28 up 3+18:01:00 14:58:15
54 processes: 1 running, 53 sleeping
CPU: 2.4% user, 0.0% nice, 15.3% system, 5.3% interrupt, 77.1% idle
Mem: 345M Active, 1236M Inact, 153M Laundry, 2158M Wired, 3903M Free
ARC: 834M Total, 46M MFU, 295M MRU, 160K Anon, 5006K Header, 488M Other
67M Compressed, 274M Uncompressed, 4.08:1 Ratio
Swap: 4096M Total, 4096M Free
PID USERNAME VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND
51021 vermaden 6005 16 6005 0 0 6005 99.92% dd
51154 vermaden 8 9 5 0 0 5 0.08% top
51036 vermaden 6 10 0 0 0 0 0.00% xterm
50907 vermaden 0 0 0 0 0 0 0.00% zsh
50905 vermaden 0 0 0 0 0 0 0.00% xterm
50815 vermaden 0 0 0 0 0 0 0.00% zsh
50813 vermaden 0 0 0 0 0 0 0.00% xterm
50755 vermaden 0 0 0 0 0 0 0.00% tail
41780 vermaden 0 0 0 0 0 0 0.00% leafpad
41255 vermaden 29 11 0 0 0 0 0.00% firefox
Another command that is very useful on FreeBSD is 'vmstat -i' which show how much interrupts are happening: # vmstat -i
interrupt total rate
irq1: atkbd0 75135 0
irq9: acpi0 2575929 8
irq12: psm0 135060 0
irq16: ehci0 1532065 5
irq23: ehci1 3265677 10
cpu0:timer 102772345 317
cpu1:timer 94199942 291
irq264: vgapci0 370466 1
irq265: em0 7017 0
irq266: hdac0 1904427 6
irq268: iwn0 148690342 459
irq270: sdhci_pci0 147 0
irq272: ahci0 20875039 64
Total 376403591 1161
I always suffer when I have to debug Linux systems because of lack of these commands.Regards, vermaden