]> git.proxmox.com Git - pve-manager.git/commitdiff
cleanup performance test
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 28 Mar 2013 09:26:54 +0000 (10:26 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 28 Mar 2013 12:11:01 +0000 (13:11 +0100)
bin/test/perftest1.pl
bin/test/perftest2.pl
bin/test/perftest3.pl

index 83d7f392c9871b6cd5c1ace1707d0b1bdb018b24..7c6c470e443655d1fec2eb698d2193dd11da22df 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-
+use lib '../../';
 use strict;
 use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
 use PVE::API2Client;
@@ -14,8 +14,8 @@ my $hostname = PVE::INotify::read_file("hostname");
 # 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) = @_;
@@ -68,7 +68,7 @@ sub run_tests {
     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'
 
index 09814598f427172e74a2905b7d4867f029b088cc..d7911e96ee52da9c02e2867b2ce90ac94f572ab9 100755 (executable)
@@ -12,7 +12,6 @@ my $hostname = PVE::INotify::read_file("hostname");
 # 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";
index bc749a62bb30b67c292db94b5b3349cd5689f1ce..f1f84b8ad0f044ccea9a1985cd004a8de5914d62 100755 (executable)
@@ -15,7 +15,7 @@ my $hostname = PVE::INotify::read_file("hostname");
 # 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 {
@@ -24,7 +24,7 @@ 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/;
        };
@@ -65,4 +65,6 @@ sub run_tests {
     print "$host: $tpq ms per query\n";
 }
 
+# why is this faster than LWP::UserAgent?
+
 run_tests($hostname); # test 'apache'