php5.cgi used 1304 CPU seconds

php5.cgi used 1304 CPU seconds

Posted by: hbchbc
Posted on: 2006-09-10 08:29:00

My site have a redirect php script with a simple code:

<?php
header("location:$_GET['url']");
?>

This php script has been hited 21000 times yesterday, and each hit used 0.05-0.08 cpu second, so this redirect php script used more than 1200 cpu seconds yesterday.

Question1: Will it be a problem?
Question2: Why this simple redirect php script(maybe all php scripts) execute time will be calculated to cpu second?

Thanks!

Process               CPU seconds      user   machine   count  average
php5.cgi 1304.9700 84.978% 5.437% 21357 0.061
awstats.pl 217.5600 14.167% 0.907% 244 0.892
sh 8.2700 0.539% 0.034% 245 0.034
ls 1.2200 0.079% 0.005% 56 0.022
perl 1.2100 0.079% 0.005% 19 0.064
bash 0.6400 0.042% 0.003% 12 0.053
vi 0.3900 0.025% 0.002% 8 0.049
tar 0.1800 0.012% 0.001% 1 0.180
cat 0.1700 0.011% 0.001% 8 0.021
mv 0.1300 0.008% 0.001% 6 0.022
chmod 0.1100 0.007% 0.000% 4 0.028
locate 0.0900 0.006% 0.000% 1 0.090
more 0.0800 0.005% 0.000% 3 0.027
editor 0.0700 0.005% 0.000% 1 0.070
wget 0.0700 0.005% 0.000% 1 0.070
uptime 0.0700 0.005% 0.000% 3 0.023
mkdir 0.0600 0.004% 0.000% 3 0.020
rm 0.0600 0.004% 0.000% 2 0.030
gzip 0.0600 0.004% 0.000% 1 0.060
id 0.0400 0.003% 0.000% 2 0.020
crontab 0.0400 0.003% 0.000% 2 0.020
bash 0.0400 0.003% 0.000% 2 0.020
sendmail 0.0300 0.002% 0.000% 1 0.030
postdrop 0.0300 0.002% 0.000% 1 0.030
w 0.0200 0.001% 0.000% 1 0.020
cp 0.0200 0.001% 0.000% 1 0.020
date 0.0200 0.001% 0.000% 1 0.020

Re: php5.cgi used 1304 CPU seconds

Posted by: Atropos7
Posted on: 2006-09-10 10:38:00

In reply to:

Question1: Will it be a problem?


It's more important whether your use affects performance rather than how much time you are using. You'll notice the average time per process for php5.cgi is low which means the PHP is not tying up the machine. It used to be a limit of 40 to 60 minutes a day and you used 26 minutes total.

In reply to:

Question2: Why this simple redirect php script(maybe all php scripts) execute time will be calculated to cpu second?


If your domain is set to run PHP as CGI then PHP scripts are executed by php.cgi or php5.cgi and that executable appears in the cpu usage reports.

cool Atropos | openvein.org

Tags: redirect phpcpu secondsphp scriptphp5cgi