#!/bin/bash /usr/bin/clear /bin/echo "**************************************************************" /bin/echo "* Please run this script as root *" /bin/echo "* *" /bin/echo "* Installing required package for Benchmark and other test *" /bin/echo "* *" /bin/echo "* Please wait *" /bin/echo "* *" /bin/echo "**************************************************************" /bin/sleep 4 /usr/bin/yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm; /usr/bin/yum install -y sysbench /usr/bin/yum install -y curl;/usr/bin/curl -s https://install.speedtest.net/app/cli/install.rpm.sh |bash; /usr/bin/yum install -y speedtest /usr/bin/yum install -y mysql /usr/bin/yum install -y mysql-server.x86_64 /usr/bin/systemctl start mysqld.service /usr/bin/mysql -u root -e "create database test"; /usr/bin/clear /bin/echo "**************************************************************" /bin/echo "* Performing Benchmark and other test *" /bin/echo "* *" /bin/echo "* Please wait *" /bin/echo "* *" /bin/echo "**************************************************************" /bin/sleep 2 /bin/echo "**************************************************************" /bin/echo "* The Storage r/w test writes 8GB of data files *" /bin/echo "* *" /bin/echo "* Please make sure you have 8GB space available *" /bin/echo "* *" /bin/echo "* Else this test will fail *" /bin/echo "* *" /bin/echo "**************************************************************" /bin/sleep 6 /usr/bin/touch /benchmark.log /usr/bin/cat /dev/null > /benchmark.log /bin/echo "**************************************************************">>/benchmark.log /bin/echo "* Disk Read/Write Test and Benchmarking *">>/benchmark.log /bin/echo "**************************************************************">>/benchmark.log /usr/bin/sysbench fileio --file-total-size=8G --file-num=24 prepare /usr/bin/clear /bin/echo "**************************************************************" /bin/echo "* Please wait while test is running *" /bin/echo "**************************************************************" /usr/bin/sysbench fileio --file-total-size=8G --file-num=24 --file-test-mode=rndrw --time=60 --file-rw-ratio=1 --threads=16 --max-requests=0 run >> /benchmark.log;/usr/bin/rm -rf test_file* /bin/echo "**************************************************************">>/benchmark.log /bin/echo "* CPU speed test Benchmarking *">>/benchmark.log /bin/echo "**************************************************************">>/benchmark.log cpu=`/usr/bin/nproc`;/usr/bin/sysbench cpu --threads=$cpu run>>/benchmark.log /bin/echo "**************************************************************">>/benchmark.log /bin/echo "* Mysql Benchmark *">>/benchmark.log /bin/echo "**************************************************************">>/benchmark.log sysbench --db-driver=mysql --mysql-user=root --mysql-db=test --tables=16 --table-size=100000 /usr/share/sysbench/oltp_read_write.lua prepare /usr/bin/clear /bin/echo "**************************************************************" /bin/echo "* Please wait while test is running *" /bin/echo "**************************************************************" sysbench --db-driver=mysql --mysql-user=root --mysql-db=test --tables=16 --table-size=100000 --threads=8 --time=60 --events=0 --rate=2500 /usr/share/sysbench/oltp_read_write.lua run>>/benchmark.log /usr/bin/mysql -u root -e "drop database test"; /bin/echo "**************************************************************">>/benchmark.log /bin/echo "* Internet Speed Test and Benchmarking *">>/benchmark.log /bin/echo "**************************************************************">>/benchmark.log /usr/bin/speedtest --accept-license>>/benchmark.log /bin/echo "**************************************************************" /bin/echo "* Disk Read/Write Test and Benchmarking *" /bin/echo "**************************************************************" /usr/bin/cat /benchmark.log|grep "MiB/s" /bin/echo " ";/bin/echo " " /bin/echo "**************************************************************" /bin/echo "* CPU speed test Benchmarking *" /bin/echo "**************************************************************" /usr/bin/cat /benchmark.log|grep "events per second" /bin/echo " ";/bin/echo " " /bin/echo "**************************************************************" /bin/echo "* Mysql Benchmark *" /bin/echo "**************************************************************" /usr/bin/cat /benchmark.log|grep -A 30 Mysql|grep "total number of events" /usr/bin/cat /benchmark.log|grep "FATAL: The event queue is full" /bin/echo " ";/bin/echo " " /bin/echo "**************************************************************" /bin/echo "* Internet Speed Test and Benchmarking *" /bin/echo "**************************************************************" /usr/bin/cat /benchmark.log|grep -e Download -e Upload /bin/echo " ";/bin/echo " " /bin/echo "**************************************************************" /bin/echo "* To review the full Benchmark report check /benchmark.log *" /bin/echo "**************************************************************"