Hi,
I'm using perl to control a sleep on a Solaris 8 platform. It is part of a load test sript. It basically executes a
command line ($smsPath/sstsms -m $null -f $subId -i $psp_3:5014 5555) and then usleeps for a configurable microsecond, before looping again. This works well up to a usleep value of 100_000 microseconds (1/10 sec) and executes the command line 10 times per second. However when I configure the usleep to a lower value 20_000 (1/50 sec) to execute the command line 50 times per second, I do not get the result I am expecting, I get approx 15 command lines per second.
The maximum I have manage to get is 20 command lines per second when setting the usleep to a very low figure 1_000.
Is there a way to increase the performance of this scripts? Or am I using the wrong tool for the job? Would compiled code be better?
Use Time::HiRes;
while ($t2 < $end) {
$t2 = time();
for ($i = 1; $i <= $smsRate; $i++) {
Time::HiRes::usleep $microseconds;
`$smsPath/sstsms -m $null -f $subId -i $psp_3:5014 5555`;
$cntR++;
if ($subId ne '1319099999') {
$subId++;
}
else {
$subId = '1319000000';
}
}
}
I'm using perl to control a sleep on a Solaris 8 platform. It is part of a load test sript. It basically executes a
command line ($smsPath/sstsms -m $null -f $subId -i $psp_3:5014 5555) and then usleeps for a configurable microsecond, before looping again. This works well up to a usleep value of 100_000 microseconds (1/10 sec) and executes the command line 10 times per second. However when I configure the usleep to a lower value 20_000 (1/50 sec) to execute the command line 50 times per second, I do not get the result I am expecting, I get approx 15 command lines per second.
The maximum I have manage to get is 20 command lines per second when setting the usleep to a very low figure 1_000.
Is there a way to increase the performance of this scripts? Or am I using the wrong tool for the job? Would compiled code be better?
Use Time::HiRes;
while ($t2 < $end) {
$t2 = time();
for ($i = 1; $i <= $smsRate; $i++) {
Time::HiRes::usleep $microseconds;
`$smsPath/sstsms -m $null -f $subId -i $psp_3:5014 5555`;
$cntR++;
if ($subId ne '1319099999') {
$subId++;
}
else {
$subId = '1319000000';
}
}
}