vps-benchmark/sysbench.sh

37 lines
1015 B
Bash

#!/bin/bash
if [ ! -f /etc/apt/sources.list.d/akopytov_sysbench.list ]; then
echo "#################################"
echo "installing sysbench"
echo "#################################"
{
curl -sL https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | bash
apt update && apt install -y sysbench
} >/dev/null 2>&1
fi
echo "" >sysbench.log
echo "#################################"
echo "CPU Benchmark"
echo "#################################"
echo ""
echo "starting CPU Benchmark"
sysbench cpu --cpu-max-prime=20000 run
echo "CPU Benchmark : [OK]"
echo ""
echo "#################################"
echo "Disk Benchmark"
echo "#################################"
echo ""
echo "starting Disk Benchmark"
sysbench fileio --file-total-size=5G prepare &>/dev/null
sysbench fileio --file-total-size=5G --file-test-mode=rndrw --time=300 --max-requests=0 run >>sysbench.log
sysbench fileio --file-total-size=5G cleanup &>/dev/null
echo "Disk Benchmark : [OK]"