CPU, memory, disk and network numbers for a server, in one run.
Handy when you are comparing VPS providers, or checking whether the box you are paying for is the box you were sold.
git clone https://github.com/sarabbafrani/servtest.git
cd servtest
chmod +x test_server_resources.sh
./test_server_resources.shservtest 2.0.0 on web-01, 10 seconds per test
cpu...
memory...
disk...
latency to 1.1.1.1...
measurement result
cpu events/sec 4821.33
memory 6284.19 MiB/sec
disk read 48.21 MiB/s
disk write 32.14 MiB/s
throughput -
latency 12.418 ms
jitter 0.932 ms
packet loss 0%
-d N seconds per CPU, memory and disk test (default 10)
-T N threads for the CPU test (default one per core)
-p HOST host to ping for latency, loss and jitter (default 1.1.1.1)
-c N pings to send (default 10)
-n HOST run an iperf3 throughput test against this host
-f SIZE size of the disk test file (default 1G)
-w DIR where to put the disk test file
-s LIST skip tests: cpu,memory,disk,network
-J print JSON
./test_server_resources.sh -d 60 -n iperf.example.com
./test_server_resources.sh -s disk,network -JThe throughput test only runs when you name a server with -n. Public iperf3 endpoints are busy, rate limited and frequently down, so a number from one of them says more about that endpoint than about your server.
Missing tools are reported and their tests skipped. Nothing is installed for you. sysbench covers CPU, memory and disk; iperf3 covers throughput; latency comes from ping, which you already have.
The disk test writes to a temporary directory that is removed afterwards, including when you interrupt the run. Use -w to test a specific mount.
sysbench for CPU, memory and disk. iperf3 if you use -n. On Debian and Ubuntu: sudo apt install sysbench iperf3.
MIT