Using ‘ab’ (Apache Benchmark) for concurrent/many different (or random) URLs, Requests or connections

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Two options:

Easy and Simple run with compiled 64bit executable version :

Download at: ab-patched-for-mutiple-requests.tar

To build it by yourself:

  • Download httpd-2.2.4.tar from here or Apache’s archive site
  • Unpack the tar file and cd into it
  • Copy and Paste the patch into the source folder and apply it.  (Download at: ab_append_requests)
  • $ cd httpd-2.2.4/support/
    $ patch -p0 < ~/ab_append_requests.patch
  • Run ./configure –with-included-apr –enable-static-ab –enable-ssl (the first option will ignore the more recent copy of apr that’ll be on your machine already, and the second will build a static binary—well, not completely static, but good enough to be independent)
  • make (you can specify -jn where n is the number of processor cores you have; this will speed up the build a lot)

Instructions

use -R command with the URL file path and other parameters you want:

./ab -n 2 -R randomList.txt -c 2 -g /test/testgnu "http://api.wiki-health.org:55555/healthbook/v1/"

randomList.txt contains your URLs or parameters to be appended to the URL. For example:

max=10&start=1406224391
max=100&start=1406224391

The connections and requests will be sent to the URL one by one from the list.

Thanks to Chris, reference: http://chrismiles.livejournal.com/21720.html

Read More

Apache Benchmark (ab) tools GNUPLOT output meanings

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Apache Benchmark (ab) tools GNUPLOT output

  • ctime: Connection Time
  • dtime: Processing Time
  • ttime: Total Time
  • wait: Waiting Time

For example:

root@wh-query:/test# ab -n 2 -c 2 -g /test/gnup "http://api.wiki-health.org:55555/healthbook/v1/health/title/ecg/datapoints?accesstoken=5b08af23d9f2490cb253fa5d221aa74e&max=10&start=1406224391"
This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking api.wiki-health.org (be patient).....done

Server Software: Apache-Coyote/1.1
Server Hostname: api.wiki-health.org
Server Port: 55555

Document Path: /healthbook/v1/health/title/ecg/datapoints?accesstoken=5b08af23d9f2490cb253fa5d221aa74e&max=10&start=1406224391
Document Length: 984 bytes

Concurrency Level: 2
Time taken for tests: 0.051 seconds
Complete requests: 2
Failed requests: 0
Total transferred: 3734 bytes
HTML transferred: 1968 bytes
Requests per second: 39.43 [#/sec] (mean)
Time per request: 50.726 [ms] (mean)
Time per request: 25.363 [ms] (mean, across all concurrent requests)
Transfer rate: 71.89 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.0 1 1
Processing: 43 46 4.7 50 50
Waiting: 42 46 4.6 49 49
Total: 44 47 4.6 51 51

Percentage of the requests served within a certain time (ms)
50% 51
66% 51
75% 51
80% 51
90% 51
95% 51
98% 51
99% 51
100% 51 (longest request)

With corresponding output of GNUPLOT:

root@wh-query:/test# cat gnup 
starttime	seconds	ctime	dtime	ttime	wait
Fri Jul 25 19:28:32 2014	1406316512	1	43	44	42
Fri Jul 25 19:28:32 2014	1406316512	1	50	51	49

Read More

Tomcat 7 hangs/freezes while starting in Ubuntu 14.04

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

I tried to run tomcat 7 in a new Ubuntu 14.04 server. It hangs every time when
INFO: Deploying configuration descriptor ......
No other error logs were produced. After searching on the web, I finally found a solution:

Add the following line into the beginning of the file: “tomcatFolder/bin/catalina.sh”
export CATALINA_OPTS="-Djava.security.egd=file:/dev/./urandom"

Then, restart tomcat, it will boot as normal!

Read More