Posts

Showing posts from June, 2017

Linux Benchmark Script

This is a handy script I've used in the past to benchmark a Linux server.  It's helpful when you want to compare the performance between 2 systems.
#!/bin/bash #basic benchmark script echo "Running basic benchmark against "$HOSTNAME cname=$(cat /proc/cpuinfo|grep name|head -1|awk '{ $1=$2=$3=""; print }') cores=$(cat /proc/cpuinfo|grep MHz|wc -l) freq=$(cat /proc/cpuinfo|grep MHz|head -1|awk '{ print $4 }') tram=$(free -m | awk 'NR==2'|awk '{ print $2 }') swap=$(free -m | awk 'NR==4'| awk '{ print $2 }') up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }') echo "Downloading Test File....." cache=$((wget --no-check-certificate -O /dev/null https://google.com/somelargetestfile) 2>&1 | tail -2 | head -1 | awk '{print $3 $4 }') echo "Testing I/O...." io=$( (dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync &&am…