1

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

1
  • 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, 2012 at 10:03

1 Answer 1

2

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.).

3
  • Unfortunately I can't use a desktop application, must be CLI.
    – Lars
    Feb 29, 2012 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, 2012 at 10:43
  • JMeter works, but it seems way too complicated for a benchmarking tool. The UI is clearly geared towards testing and QA. It also crashed on my 32G desktop when I tried 1000 simultaneous connections which should only take 1G at 1MB per page. I guess it's only suitable for benchmarking sites hosted on a Raspberry Pi lol
    – Navin
    Feb 15, 2022 at 3:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .