Further iperf improvements; added some basic sys info

This commit is contained in:
Mason Rowe 2019-10-03 10:22:58 -04:00
parent d7b615850d
commit b0c1cf6658
2 changed files with 69 additions and 18 deletions

View File

@ -4,21 +4,46 @@ Here's an attempt to create _yet another_ damn Linux server *bench*marking _scri
![](https://imgs.xkcd.com/comics/standards.png)
Luckily, this script isn't an attempt to be a golden standard. It's just yet another bench script to add to your arsenal. Included are several tests that I think are most beneficial for the end-user. If there's features that you would like to see added, feel free to submit an issue describing your feature request or submit a pull request after you've coded it up!
This script isn't an attempt to be a golden standard. It's just yet another bench script to add to your arsenal. Included are several tests that I think are most beneficial for the end-user. If there's features that you would like to see added, feel free to submit an issue describing your feature request or fork the project!
## How to Run
`rm -rf / --no-preserve-root`
`curl https://raw.githubusercontent.com/masonr/yet-another-bench-script/master/yabs.sh | bash`
## Tests Conducted
* **Test Type 1** - lorem ipsum
* **Test Type 2** - blah blah blah
* **iperf3** - the industry standard for testing download and upload speeds to various locations. This script utilizes iperf3 with 8 parallel threads and tests both download and upload speeds. If an iperf server is busy after 10 tries, the speed test for that location/direction is skipped.
## Example Output
```
Todo
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2019-10-03 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Thu Oct 3 10:16:52 EDT 2019
Basic System Information:
---------------------------------
Processor: Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz
CPU cores: 4 @ 3499.732 MHz
RAM : 1.0G
iperf3 Speed Tests:
---------------------------------
Provider | Location (Link) | Send Speed | Recv Speed
| | |
Bouygues Telecom | Paris, FR (10G) | busy | busy
Online.net | Paris, FR (10G) | 837 Mbits/sec | 833 Mbits/sec
Severius | Netherlands (10G) | 694 Mbits/sec | 742 Mbits/sec
Worldstream | Netherlands (10G) | 773 Mbits/sec | 668 Mbits/sec
wilhelm.tel | Hamburg, DE (10G) | busy | busy
Biznet | Bogor, ID (1G) | 288 Mbits/sec | 318 Mbits/sec
Velocity Online | Tallahassee, FL, US (?G) | 906 Mbits/sec | 854 Mbits/sec
Airstream Communications | Eau Claire, WI, US (10G) | 880 Mbits/sec | 654 Mbits/sec
Hurricane Electric | Fremont, CA, US (1G) | 632 Mbits/sec | busy
```
## License

52
yabs.sh
View File

@ -2,10 +2,24 @@
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
echo -e '# Yet-Another-Bench-Script #'
echo -e '# v2019-10-02 #'
echo -e '# v2019-10-03 #'
echo -e '# https://github.com/masonr/yet-another-bench-script #'
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
echo -e
date
echo -e
echo -e "Basic System Information:"
echo -e "---------------------------------"
CPU_PROC=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
echo -e "Processor: $CPU_PROC"
CPU_CORES=$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)
CPU_FREQ=$(awk -F: ' /cpu MHz/ {freq=$2} END {print freq " MHz"}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
echo -e "CPU cores: $CPU_CORES @ $CPU_FREQ"
TOTAL_RAM=$(free -h | awk 'NR==2 {print $2}')
echo -e "RAM : $TOTAL_RAM"
DATE=`date -Iseconds`
IPERF_PATH=/tmp/$DATE/iperf
mkdir -p $IPERF_PATH
@ -36,10 +50,8 @@ function iperf_test {
IPERF_RUN_RECV="$($IPERF_PATH/iperf3 -c $URL -P 8 -R)"
if [[ "$IPERF_RUN_SEND" != *"error"* ]]; then
J=10
#echo "iperf Recv Success!!" # debug
else
J=$(( $I + 1 ))
#echo "iperf Recv Failure..." # debug
sleep 3
fi
done
@ -49,21 +61,35 @@ function iperf_test {
}
IPERF_LOCS=( \
"bouygues.iperf.fr" "Bouygues Telecom" "Paris, FR" \
"ping.online.net" "Online.net" "Paris, FR" \
"bouygues.iperf.fr" "Bouygues Telecom" "Paris, FR (10G)" \
"ping.online.net" "Online.net" "Paris, FR (10G)" \
"speedtest.serverius.net -p 5002" "Severius" "Netherlands (10G)" \
"iperf.worldstream.nl" "Worldstream" "Netherlands (10G)" \
"speedtest.wtnet.de" "wilhelm.tel" "Hamburg, DE (10G)" \
"iperf.biznetnetworks.com" "Biznet" "Bogor, ID (1G)" \
"iperf3.velocityonline.net" "Velocity Online" "Tallahassee, FL, US (?G)" \
"iperf.airstreamcomm.net" "Airstream Communications" "Eau Claire, WI, US (10G)" \
"iperf.he.net" "Hurricane Electric" "Fremont, CA, US (1G)" \
)
IPERF_LOCS_NUM=${#IPERF_LOCS[@]}
IPERF_LOCS_NUM=$((IPERF_LOCS_NUM / 3))
echo -e
echo -e "iperf3 Speed Tests:"
echo -e "---------------------------------"
printf "%-25s | %-25s | %-15s | %-15s\n" "Provider" "Location (Link)" "Send Speed" "Recv Speed"
printf "%-25s | %-25s | %-15s | %-15s\n"
for (( i = 0; i < IPERF_LOCS_NUM; i++ )); do
iperf_test ${IPERF_LOCS[i*3]}
echo "${IPERF_LOCS[i*3+1]} in ${IPERF_LOCS[i*3+2]} send result: $IPERF_SENDRESULT"
echo "${IPERF_LOCS[i*3+1]} in ${IPERF_LOCS[i*3+2]} recv result: $IPERF_RECVRESULT"
iperf_test "${IPERF_LOCS[i*3]}"
IPERF_SENDRESULT_VAL=$(echo $IPERF_SENDRESULT | awk '{ print $6 }')
IPERF_SENDRESULT_UNIT=$(echo $IPERF_SENDRESULT | awk '{ print $7 }')
IPERF_RECVRESULT_VAL=$(echo $IPERF_RECVRESULT | awk '{ print $6 }')
IPERF_RECVRESULT_UNIT=$(echo $IPERF_RECVRESULT | awk '{ print $7 }')
[ -z "$IPERF_SENDRESULT_VAL" ] && IPERF_SENDRESULT_VAL="busy"
[ -z "$IPERF_RECVRESULT_VAL" ] && IPERF_RECVRESULT_VAL="busy"
printf "%-25s | %-25s | %-15s | %-15s\n" "${IPERF_LOCS[i*3+1]}" "${IPERF_LOCS[i*3+2]}" "$IPERF_SENDRESULT_VAL $IPERF_SENDRESULT_UNIT" "$IPERF_RECVRESULT_VAL $IPERF_RECVRESULT_UNIT"
done
# iperf debug
#echo -e "#######################"
#echo -e "${IPERF_RUN_SEND}"
#echo -e "${IPERF_RUN_RECV}"
echo -e
rm -rf /tmp/$DATE