I'm using AB to benchmark one of my servers but it doesn't seem to parse the images at all.

If I use ...

ab http://foobar.com/image1.jpg

It works brilliantly, but if I use ...

ab http://foobar.com/index.php

It doesn't request the images at all (I'm reading log output), index.php contains a small benchmark script as well as ...

<img src="image1.jpg">

If I browse index.php manually in a browser it requests the image, any ideas?

Best Regards

  • I just read that AB doesn't work in the same way as a person browsing a site, so I guess this works as intended, so another question would be: can I mimic a real browser? In other words, fetch all images in this particular case. – Lars Feb 29 '12 at 10:03

I suggest using JMeter for this sort of load testing. ab is great as a quick test to check how your code manages under load but lacks some features.

JMeter has a tick box to tell it to request referenced resources for HTTP requests(such as images, css etc.).

| improve this answer | |
  • Unfortunately I can't use a desktop application, must be CLI. – Lars Feb 29 '12 at 10:40
  • 1
    I believe JMeter can run as a daemon on a server (though I have never used this functionality myself). You may find it easier to develop the test plan on a GUI machine then upload the resultant JMX file to the server version of JMeter to run (as opposed to writing the JMX file by hand). – webtoe Feb 29 '12 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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