C
Charlie
Hi Folks,
I need some help from you about the thread issue I have.
What I want to do is to simulate multi users to access one web server.
I want to simulate as many as 200 users to assess that web server to
check the performance from both the web server and the backend DB.
The ways that I emploment it are: 1). to have the apache(version
1.3.31) installed on the Linux platform. 2) I am using the perl
5.8.4, along with some perl modules, such as Mechanize, threads to
create the test scripts. And I put the test scripts under the dir of
(Apache)/cgi-bin/.
In that way, I can enter the user number from the browser from
anywhere and can do the rest of work by just clicking one button.
Following is part of my main function:
"package LoadTest;
....
use threads;
use threads::shared;
my ($Input_value, %Inputs, $total);
my $CGIobj = new CGI;
%Inputs = $CGIobj->Vars;
my @threads;
for ( 1..$Inputs{UserNumber} ) {
my $thread;
$thread = new threads(\&Case1, \%Inputs);
push(@threads, $thread);
}
$_-> join foreach(@threads);
}
sub Case1 {
....
}
"
As you can see, I am trying to create a certain amount of
threads(users) to invoke the same function,"Case1".
During the runtime, that program runs perfectly fine if there are 20
users, but when I give more users, such as 50, or even 100, something
is going wrong.
For example, once I submit 100 users, on that linux platform, I can
see the amount threads keeps growing untill it reaches that number.
Then before the sub-function calls are finished, all the threads are
exit at once, without any indications, as if they are being killed
Can someone tell me what might be the problem, all maybe you can give
me a better way to work around this. I need to do the simulations of
as many as 200 users.
Thanks a lot for the help !!!
CJ
I need some help from you about the thread issue I have.
What I want to do is to simulate multi users to access one web server.
I want to simulate as many as 200 users to assess that web server to
check the performance from both the web server and the backend DB.
The ways that I emploment it are: 1). to have the apache(version
1.3.31) installed on the Linux platform. 2) I am using the perl
5.8.4, along with some perl modules, such as Mechanize, threads to
create the test scripts. And I put the test scripts under the dir of
(Apache)/cgi-bin/.
In that way, I can enter the user number from the browser from
anywhere and can do the rest of work by just clicking one button.
Following is part of my main function:
"package LoadTest;
....
use threads;
use threads::shared;
my ($Input_value, %Inputs, $total);
my $CGIobj = new CGI;
%Inputs = $CGIobj->Vars;
my @threads;
for ( 1..$Inputs{UserNumber} ) {
my $thread;
$thread = new threads(\&Case1, \%Inputs);
push(@threads, $thread);
}
$_-> join foreach(@threads);
}
sub Case1 {
....
}
"
As you can see, I am trying to create a certain amount of
threads(users) to invoke the same function,"Case1".
During the runtime, that program runs perfectly fine if there are 20
users, but when I give more users, such as 50, or even 100, something
is going wrong.
For example, once I submit 100 users, on that linux platform, I can
see the amount threads keeps growing untill it reaches that number.
Then before the sub-function calls are finished, all the threads are
exit at once, without any indications, as if they are being killed
Can someone tell me what might be the problem, all maybe you can give
me a better way to work around this. I need to do the simulations of
as many as 200 users.
Thanks a lot for the help !!!
CJ