I usually run 'w' first when troubleshooting unknown machines
On FreeBSD systems there are two great commands that are not available on other systems.<p>These are &#x27;gstat&#x27; and &#x27;top -m io&#x27; commands, both I&#x2F;O related.<p>Often in top&#x2F;htop there is not much happening but the server is very slow, a lot of the times its because of I&#x2F;O operations.<p>The &#x27;gstat&#x27; command will tell You (besides other useful statistics) how much the storage devices are loaded:<p><pre><code>  # gstat
  dT: 1.001s  w: 1.000s
   L(q)  ops&#x2F;s    r&#x2F;s   kBps   ms&#x2F;r    w&#x2F;s   kBps   ms&#x2F;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&#x2F;boot
      0     65      0      0    0.0     63    671    0.2    1.5| gpt&#x2F;sys
      0      0      0      0    0.0      0      0    0.0    0.0| gpt&#x2F;local
      0      0      0      0    0.0      0      0    0.0    0.0| zvol&#x2F;local&#x2F;SWAP


</code></pre>
The &#x27;top -m io&#x27; show which processes does how much I&#x2F;O:<p><pre><code>  # 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


</code></pre>
Another command that is very useful on FreeBSD is &#x27;vmstat -i&#x27; which show how much interrupts are happening:<p><pre><code>  # 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


</code></pre>
I always suffer when I have to debug Linux systems because of lack of these commands.<p>Regards,
vermaden