Simple Perl script to stress apache

I’ve made this to stress this blog a little, and see how many requests could it handle.

#!/usr/bin/perl

use strict;
use LWP::Simple;
use LWP::UserAgent;
use Parallel::ForkManager;

my $pm = new Parallel::ForkManager(3);

for (1 .. 10_000) {
	my $pid = $pm->start and next;
	my $ua = new LWP::UserAgent;
	print "Request $_\n";
	$ua->timeout(120);
	my $url='http://www.rocchi.us/';
	my $request = new HTTP::Request('GET', $url);
	my $response = $ua->request($request);
	my $content = $response->content();
	#print $content;
	$pm->finish;
}

Bye