25

Any one know about a load test tool like "Apache Bench" to send variable URLs. (Same server, but different Query Strings)

For example,

ab -text list.txt -n 1000 http://test.com/search?

list.txt

name=abc&age=10
name=pqr&age=20
anything=anything&age=30
......

Note : Actually there is no such option -text in apache bench

6 Answers 6

22

Try siege as it offers what you need. You could create url files that use bash like parameters so that you don't have to repeat yourself. It also support basic auth, POST, a login url and much more.

siege -f urls.txt 

urls.txt:

URL=https://www.example.com/
$(URL)index.php?ab=1
$(URL)site.php?different=12

You can find more here: http://www.joedog.org/siege-home/

1
  • 1
    Your urls.txt example results Seg Fault in my case. I had to remove the vars and hard code the URL so it would work out for me. This actually looks more like a siege bug.
    – Igal Alkon
    Feb 2, 2015 at 16:28
7

You can use this following project apachebench for multiple urls Apache Bench for Multiple URL

Supported Multi URL requests for ApacheBench. You can set URL list as '-L filename' and also confirm response of document length for each requests.

4

from a commandline in windows:

for /F %q in (list.txt) DO ab -n 1000 https://test.com/search?%q

I don't know Apache Bench nor how it collects its data. My approach will probably start a new collection of data for each line in list.txt which is something you might not want. You'll have to aggregate the results of different runs by hand.

(to debug:

for /F %q in (list.txt) DO echo ab -n 1000 https://test.com/search?%q

which will output on the console the statement that will execute)

3
  • It didn't work for me. particular script(php/servlet) receives empty params.
    – sura2k
    Jan 12, 2012 at 11:47
  • are you running this from a commandline or from a commandfile? In a commandfile replace %q with %%q (two times).
    – rene
    Jan 12, 2012 at 12:40
  • I forgot to tell. What about if it is an https?
    – sura2k
    Jan 13, 2012 at 4:23
1

If you are prepared to get the Apache source code and port the patch at http://chrismiles.livejournal.com/21720.html to the current version of Apache's ab.c source (some comfort with C needed, but not much), you should get the equivalent of your -text parameter in ab (actually you have the ability to append to your requests which is good for benching POSTs where you only want to vary a subset of the parameters).

I'm currently trying this out myself, so the jury is still out... but early indicators are that this approach works nicely.

1
  • 1
    Has anyone tried to use it and can share any experiences? It's an old code now... Sep 15, 2015 at 22:35
0

I found this SuperBenchmark tool. It is on top of Dotnet which can be installed even on Mac OS or Ubuntu server. I installed it on the latter one.

https://github.com/aliostad/SuperBenchmarker

-2

Apache Bench for Multiple URL does not work for long URLs.

1
  • 7
    What is a "long URL" ? Feb 17, 2014 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.