Traffic Generators: Difference between revisions

 
(3 intermediate revisions by the same user not shown)
Line 28:
 
for i in `seq 1 99999`; do echo "Status Code:"; curl -s -o /dev/null -w "%{http_code}" https://10.1.1.1; sleep 1; done
 
;Bash Script
<pre>
# get output, append HTTP status code in separate line, discard error message
OUT=$( curl -sfI --connect-timeout 1 http://10.52.200.32/ | grep "HTTP" )
 
# get exit code
RET=$?
 
if [[ $RET -ne 0 ]] ; then
echo "Time out: $RET"
else
echo "$OUT"
fi
</pre>
while true; do ./monitor.sh; sleep 1; done
 
= Apache Benchmark =
Line 129 ⟶ 145:
Source: [http://manpages.ubuntu.com/manpages/xenial/man1/slowhttptest.1.html ubuntu.com]
{{UC}}
 
= Bombardier =
 
Source: [https://softwaretester.info/http-benchmarking-with-bombardier/ softwaretester.info]
 
Preparation
sudo apt install -y curl git
curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
tar xvf go1.8.linux-amd64.tar.gz
sudo chown -R root:root go
sudo mv go /usr/local/
 
Configure go (for user)
mkdir ~/.go
echo "GOPATH=$HOME/.go" >> ~/.bashrc
echo "export GOPATH" >> ~/.bashrc
echo "PATH=\$PATH:/usr/local/go/bin:\$GOPATH/bin" >> ~/.bashrc
 
source ~/.bashrc
go version
 
Install bombardier
go get -u github.com/codesenberg/bombardier
bombardier --help
 
Usage:
*Run with 10 connections on 5 sec and show latency statistics.
bombardier -d 5s -c 10 -l -k https://www.heise.de
*Test for 60 seconds at 250 Insecure connections per second :
bombardier -c250 -k -d 60s "https://10.70.28.12/tools/healthcheck?api-key=0145463c-df61-4ebe-bbf1-ed3f43t4f57"
 
<br />