Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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
add comment

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
Unfortunately I can't use a desktop application, must be CLI. –  Lars Feb 29 '12 at 10:40
    
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
    
Aha, I'll see if I can find something, thank you. –  Lars Feb 29 '12 at 10:47
    
Worked great, thanks! –  Lars Mar 1 '12 at 12:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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