mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-26 21:20:38 +00:00
f6550c4888
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@226 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
33 lines
689 B
Perl
Executable File
33 lines
689 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# Test using ApacheBench against an HTTP server with lots of idle clients
|
|
#
|
|
use IO::Socket;
|
|
use Getopt::Long;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
our $NCLIENT = 3000;
|
|
our $BASELINE = 0;
|
|
our @CLIENT;
|
|
|
|
sub create_client {
|
|
my $socket = new IO::Socket::INET (
|
|
PeerAddr => '127.0.0.1',
|
|
PeerPort => 8080,
|
|
Proto => 'tcp',
|
|
)
|
|
or die $!;
|
|
push @CLIENT, $socket;
|
|
}
|
|
|
|
GetOptions("baseline" => \$BASELINE, "idle=i" => \$NCLIENT) or die;
|
|
|
|
for (my $i = 0; $i < $NCLIENT; $i++) {
|
|
create_client();
|
|
}
|
|
print "====> Created $NCLIENT idle connections <=====\n";
|
|
|
|
system "ab -n 5000 -c 500 http://localhost:8080/";
|