Created
February 3, 2017 07:42
Star
You must be signed in to star a gist
DNS Benchmark (Child forks + Parallel support)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -m | |
hostname="ns1" | |
domain="example.local" | |
target_dns="dns-unbound01" | |
query_count=3 | |
forks=200 | |
for i in `seq $forks` | |
do | |
for ((i=1; i \<\= ${query_count};i++)) | |
do | |
dig ${hostname}.${domain} @${target_dns} | |
done & | |
done | |
# Wait for all parallel jobs to finish | |
while [ 1 ]; do fg 2> /dev/null; [ $? == 1 ] && break; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -m | |
hostname="ns2" | |
domain="example.local" | |
target_dns="dns-unbound01" | |
query_count=3 | |
forks=200 | |
for i in `seq $forks` | |
do | |
for ((i=1; i \<\= ${query_count};i++)) | |
do | |
dig ${hostname}.${domain} @${target_dns} | |
done & | |
done | |
# Wait for all parallel jobs to finish | |
while [ 1 ]; do fg 2> /dev/null; [ $? == 1 ] && break; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time parallel --gnu --eta -j $(lscpu | awk '$1~/CPU\(s\):/{print $2}') ::: ./dns-bench*.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment