arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post4VPS Benchmarking Script
#11
Does this script works with all Linux OS or supported with selected OS only?
#12
(01-14-2020, 11:32 AM)youstable Wrote: Does this script works with all Linux OS or supported with selected OS only?

I have tested this script on various Linux family OSes and there hasn't been an error yet!

You can test it if you want! (。•̀ᴗ-)✧
Terminal
Solo Developer
#13
(01-14-2020, 11:32 AM)youstable Wrote: Does this script works with all Linux OS or supported with selected OS only?

You can be the one to find out if you are using a rather not so common Linux Distro.

This script works on pretty much all common Linux Distributions such as:
- Debian (and Distros based on it)
- Ubuntu Server (and Distros based on it)
- CentOS
- Fedora Server
- Redhat Enterprise Linux (same as Fedora/CentOS as they're based on RHEL)

I even used this script on the developer console of Chromium OS and it worked there.

This version of the script as far as I know doesn't need anything additional to be installed. So the chance is very high that it works on pretty much all Linux distributions if they're not very old.

Report back so that OP can maybe fix it if it doesn't work for whatever reason.
[Image: zHHqO5Q.png]
#14
@youstable Apologies for the late reply. It's exactly how @chanalku91 and @"Hidden Refuge" highlighted. It's a Benchmarking Script that's meant to work on almost all Linux platforms.

I've tested this script on a variety of platforms. As HR highlighted this script is even working on the Chromium Developer console.

To conclude, if you've any suggestions please feel free to post them here. As I'd said in the repo as well, this shall be the official support as well as suggestion thread for the script.

I'm working out on a few improvements, however those are only locally available for me and I'm testing out before releasing a new version of the script with a free formatting fixes as well as some nice customizations regarding the CPU benchmarking.

Regards,
Sayan Bhattacharyya,

Heartiest thanks to Post4VPS and Virmach for my wonderful VPS 9!
#15
Hello there!

I opened the first issue on your repo since I think that the issue feature on Github should be used much more to report issues on repos (after all it was made for that purpose).

So here it is: https://github.com/sohamb03/bench-sh/issues/1

It's about a dead speed test mirror for IPv4 speed testing.
[Image: zHHqO5Q.png]
#16
Thanks for reporting the issue @"Hidden Refuge". It gas accordingly been fixed and I've replaced the dead server with one of my own on my Atlanta VPS.

In addition to this, I've also added a Sydney, AU speedtest server, so now we've two speedtests from the continent. :-)

Regards,
Sayan Bhattacharyya,

Heartiest thanks to Post4VPS and Virmach for my wonderful VPS 9!
#17
(.............)
# Reading total memory in MB
tram=$( free -m | awk 'NR==2 {print $2}' )
# Reading Swap in MB
vram=$( free -m | awk 'NR==3 {print $2}' )
(.............)
echo "Memory : $tram MB" | tee -a $HOME/bench.log
echo "Swap : $vram MB" | tee -a $HOME/bench.log

'free -m' gives its output in mebibytes (symbol: MiB) and not in megabytes (symbol: MB.)
# The unit MB is defined by the International System of Units (SI).
1 Megabyte (MB)  = (1000)^2 bytes = 1000000 bytes.
# The unit MiB is defined by the International Electrotechnical Commission (IEC)
1 Mebibyte (MiB) = (1024)^2 bytes = 1048576 bytes.
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)
#18
Thanks for pointing that out @fChk! I'll be fixing that soon when I'm on a PC, and will update that here.
Sayan Bhattacharyya,

Heartiest thanks to Post4VPS and Virmach for my wonderful VPS 9!
#19
In consideration of the issue highlighted by @fChk, the bench-sh script has been updated accordingly.

Along, with that the dead Sydney speedtest mirror has been removed. However, we still have the Melbourne mirror under Australia.

Besides, a few minor formatting fixes have been implemented. Smile

Kind Regards,
Sayan Bhattacharyya,

Heartiest thanks to Post4VPS and Virmach for my wonderful VPS 9!
#20
@sohamb03

iotest () {
echo "Buffered Sequential Write Speed" | tee -a $HOME/bench.log
echo "-------------------------------" | tee -a $HOME/bench.log

# Measuring disk speed with DD
io=$( ( dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//' )
io2=$( ( dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//' )
io3=$( ( dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync && rm -f test_$$ ) 2>&1 | awk -F, '{io=$NF} END { print io}' | sed 's/^[ \t]*//;s/[ \t]*$//' )

# Calculating avg I/O (better approach with awk for non int values)
ioraw=$( echo $io | awk 'NR==1 {print $1}' )
ioraw2=$( echo $io2 | awk 'NR==1 {print $1}' )
ioraw3=$( echo $io3 | awk 'NR==1 {print $1}' )
ioall=$( awk 'BEGIN{print '$ioraw' + '$ioraw2' + '$ioraw3'}' )
ioavg=$( awk 'BEGIN{print '$ioall'/3}' )

# Output of DD result
echo "I/O (1st run) : $io" | tee -a $HOME/bench.log
echo "I/O (2nd run) : $io2" | tee -a $HOME/bench.log
echo "I/O (3rd run) : $io3" | tee -a $HOME/bench.log
echo "Average I/O : $ioavg MB/s" | tee -a $HOME/bench.log

echo "" | tee -a $HOME/bench.log
}

The bench.sh -io section of the script -shown above- assumes that all I/O rates are in MB/s which may be a valid general assumption but isn't always true, like in VirMach's VPS-9 @Buffalo :
# /............/bench.sh

   //   ) )                                  ||   / / //   ) ) //   ) )
  //___/ /  ___      ___   __  ___ //___/ /  ||  / / //___/ / ((        
 / ____ / //   ) ) ((   ) ) / /   /____  /   || / / / ____ /    \      
//       //   / /   \ \    / /        / /    ||/ / //             ) )  
//       ((___/ / //   ) ) / /        / /     |  / //       ((___ / /    

              FREE VPS PROVIDER  -  https://post4vps.com            

Benchmark started on Mon Jan  4 17:16:03 +01 2021
Full benchmark log: /root/bench.log

(.............................)

Buffered Sequential Write Speed
-------------------------------
I/O (1st run) : 1.1 GB/s
I/O (2nd run) : 987 MB/s
I/O (3rd run) : 978 MB/s
Average I/O : 655.367 MB/s

Any time there is a mixed speed units in the I/O tests, the Average speed will be WRONG!... as a consequence of that assumption.

The fix is to introduce a conversion mechanism that can trap all GB/s units and convert them in MB/s, like HR's did in his own version of the script (see below), or something more general that systematically convert all units into Bytes then format the average result back again in the adhoc unit value (this later method is the one I use in my own disk I/O bench.)

HR's version:
(.......same starting code here.........)

# I/O without units for calculation (better approach with awk for non int values)
ioraw=$( echo $io | awk 'NR==1 {print $1}' )
ioraw2=$( echo $io2 | awk 'NR==1 {print $1}' )
ioraw3=$( echo $io3 | awk 'NR==1 {print $1}' )
# Converting possible GB/s results to MB/s value for proper calculation afterwards
iounit=$( echo $io | awk 'NR==1 {print $2}' )
iounit2=$( echo $io2 | awk 'NR==1 {print $2}' )
iounit3=$( echo $io3 | awk 'NR==1 {print $2}' )
# Converting 1st benchmark run
if [ "$iounit" == "GB/s" ]
then
        ioconv=$( bc -l <<<"($ioraw * 1000)" )
        ioconv=$( echo ${ioconv%.*} )
else
        ioconv=$ioraw
fi
# Converting 2nd benchmark run
if [ "$iounit2" == "GB/s" ]
then
        ioconv2=$( bc -l <<<"($ioraw2 * 1000)" )
        ioconv2=$( echo ${ioconv2%.*} )
else
        ioconv2=$ioraw2
fi
# Converting 3rd benchmark run
if [ "$iounit3" == "GB/s" ]
then
        ioconv3=$( bc -l <<<"($ioraw3 * 1000)" )
        ioconv3=$( echo ${ioconv3%.*} )
else
        ioconv3=$ioraw3
fi
# Calculating all IO results and avg IO
ioall=$( awk 'BEGIN{print '$ioconv' + '$ioconv2' + '$ioconv3'}' )

ioall=$( echo ${ioall%.*} )
ioavg=$( awk 'BEGIN{print '$ioall'/3}' )
ioavg=$( echo ${ioavg%.*} )
ioavggbs=$( echo "scale=2; $ioavg/1000" | bc )
# Output of DD result
echo "I/O (1st run) : $io" | tee -a $HOME/bench.log
echo "I/O (2nd run) : $io2" | tee -a $HOME/bench.log
echo "I/O (3rd run) : $io3" | tee -a $HOME/bench.log
echo "Average I/O : $ioavg MB/s or $ioavggbs GB/s" | tee -a $HOME/bench.log
echo "" | tee -a $HOME/bench.log

In my script I'm using a dd_conv subroutine that take care of the conversions; it's used like this:
dd_conv() {
speed=$1

if [ "$2" == 'GB/s' ] || [ "$2" == "GB/sec" ]; then
 speed=$(echo "1000*1000*1000*$1" |bc)
elif [ "$2" == "MB/s" ] || [ "$2" == "MB/sec" ]; then
 speed=$(echo "1000*1000*$1" |bc)
elif [ "$2" == 'KB/s' ] || [ "$2" == "KB/sec" ]; then
 speed=$(echo "1000*$1" |bc)
elif [ "$2" == 'B/s' ] || [ "$2" == "B/sec" ]; then
 speed=$1
fi
echo $speed
}

My 'storageBufferedWrite' test which uses the subroutine above:
storageBufferedWrite(){
printf '\n'
echo "Testing storage buffered write speed."
avgRate=0
iter=3
sync
for i in {1..3}; do
 printf 'Pass %s... ' $i
 io=$( ( dd if=/dev/zero of=test_$$ oflag=nocache conv=notrunc,fdatasync count=0 bs=64k count=16k  ) 2>&1 | awk -F, '{io=$NF} END { print io}'; rm -f test_$$ )
 echo $io
 speed=$( dd_conv $io )
 avgRate=$(echo "$avgRate + $speed" | bc)
done
avgRate=$(echo "$avgRate / $iter" | bc)
avgRate=$( formater $avgRate)
echo "Buffered Write Speed = $avgRate"
}

Feel free to use anyone that suits you most...
VirMach's Buffalo_VPS-9 Holder (Dec. 20 - July 21)
microLXC's Container Holder (july 20 - ?)
VirMach's Phoenix_VPS-9 Holder (Apr. 20 - June 20)
NanoKVM's NAT-VPS Holder (jan. 20 - ?)


person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting