#!/usr/bin/perl -w
-
+use lib '../../';
use strict;
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
use PVE::API2Client;
# but we can simply create a ticket if we are root
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
-my $wcount = 4;
-my $qcount = 500;
+my $wcount = 1;
+my $qcount = 100;
sub test_rpc {
my ($host) = @_;
print "$host: $tpq ms per query\n";
}
-# TODO: Apache is much slower, why?
+# TODO: Apache is much slower, why? (SSL?)
run_tests("localhost"); # test 'pvedaemon'
# but we can simply create a ticket if we are root
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
-
my $cmd = "ab -c 2 -n 1000 -C 'PVEAuthCookie=$ticket' https://$hostname:8006/api2/json";
print "$cmd\n";
system($cmd) == 0 || die "command failed - $!\n";
# but we can simply create a ticket if we are root
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
-my $wcount = 2;
+my $wcount = 1;
my $qcount = 100;
sub test_rpc {
for (my $i = 0; $i < $qcount; $i++) {
eval {
my ($page, $response, %reply_headers)
- = get_https($hostname, 8006, '/api2/json',
+ = get_https($host, 8006, '/api2/json',
make_headers(Cookie => "PVEAuthCookie=$ticket"));
die "$response\n" if $response !~ m/200 OK/;
};
print "$host: $tpq ms per query\n";
}
+# why is this faster than LWP::UserAgent?
+
run_tests($hostname); # test 'apache'