• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Load Testing > Writing Your Own Load Testing Tools

Writing Your Own Load Testing Tools

If you just want to give your server 100 hits, a simple way to do it is with the following shell script. Then take the difference between the start and end times output by the script and divide 100 by that time to get the number of hits per second you delivered to the web server. This script forks a new Lynx browser process for each hit, so the script is not efficient and the total running time is not very accurate, but you can see how easy it is to write a simple load generation tool in a Unix shell language.

#!/bin/bash
CNT=0
date
while [ "100" -ne "$CNT" ]
do
    lynx -source http://patrick.net/ > /dev/null &
    CNT=`expr $CNT + 1`
done
date

You could also write a similar tool in Java or Perl and get a more accurate reading and heavier generated load by eliminating Lynx startup time.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint