ID: 10299
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Performance problem
Description: CPU and Memory Spike

This is vmstat show if I keep reloading the script

procs      memory     page                    disks     faults      cpu
 r b w     avm   fre  flt  re  pi  po  fr  sr da0 da1   in   sy  cs us sy id
 1 4 0   73860 13432    4   0   0   0   0   0   2   0  382 3804 258 16  1 83
 0 4 0   73860 13424    4   0   0   0   0   0   0   0  357 3789 245 15  4 81
 1 4 0   73860 13424    4   0   0   0   0   0   0   0  373 3763 263 14  3 83
 2 4 0   73860 13416  142   0   0   0 139   0   0   0  402 6155 285 26  4 70
 0 4 0   73860 13408    4   0   0   0   4   0  11   0  366 3179 220 11  2 87
 1 4 0   73860 13400    4   0   0   0   0   0   0   0  358 3943 257 15  3 82
 2 4 0   73860 13400    4   0   0   0   0   0   0   0  340 4201 240 12 42 45
 2 4 0   73860 13400    4   0   0   0   0   0   0   0  240 1842  90  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0  19   0  265 1802  98  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  241 1753  93  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  239 1729  96  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  241 1612  94  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  243 1576  97  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  243 1541  98  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  239 1487 102  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  241 1401  93  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  251 1405 100  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  246 1338 101  0 100  0
 2 4 0   73116 13400    4   0   0   0   0   0   0   0  238 1297  94  0 100  0
 2 4 0   73860 13400    4   0   0   0   0   0   0   2  243 1282 100  0 100  0
 2 4 0   73860 13400    4   0   0   0   0   0   0   0  239 1223  89  0 100  0
 2 4 0   73860 13400    4   0   0   0   2   0   9  16  300 1180  92  0 100  0
 procs      memory     page                    disks     faults      cpu
 r b w     avm   fre  flt  re  pi  po  fr  sr da0 da1   in   sy  cs us sy id
 3 4 0   73860 13400    4   0   0   0   0   0   0   0  251 1156  90  0 100  0
 3 4 0   50296 13400    4   0   0   0   0   0   6   0  258 1116  93  0 100  0
 2 4 0   50296 13400    4   0   0   0   0   0   0   0  240 1108  83  0 100  0
 3 4 0   50296 13400    4   0   0   0   0   0   0   0  245 1064  92  0 100  0
 3 4 0   46988 13400    4   0   0   0   0   0   0   0  242 1031  83  0 100  0
 3 4 0   46988 13400    4   0   0   0   0   0   0   0  242  989  82  0 100  0
 2 4 0   46988 13400    4   0   0   0   0   0   0   0  243 1010  85  0 100  0
 2 4 0   46988 13400    4   0   0   0   0   0   1   0  241  985  81  0 100  0
 2 4 0   46988 13400    4   0   0   0   0   0   0   0  241  971  89  1 99  0
 2 4 0   46988 13400    4   0   0   0   0   0   0   0  243  940  74  0 100  0
 3 4 0   46988 13400    4   0   0   0   2   0   8   0  250  926  80  0 100  0
 2 4 0   46988 13400    4   0   0   0   0   0   1   0  245  930  88  0 100  0
 3 4 0   46988 13400    4   0   0   0   0   0   0   0  240  905  80  0 100  0
 2 4 0   46988 13400    4   0   0   0   0   0   7   0  253  920 100  0 98  2
 3 4 0   47332 13056   90   0   0   0   0   0   0   0  239 2113 116  3 97  0
 2 4 0   46588 13048    4   0   0   0   0   0   1   0  243 2334 103  1 99  0
 1 4 0   46244 13392    4   0   0   0  86   0   8   0  276 4383 140  7 19 74
 1 4 0   47896 13184   59   0   0   0   0   0   2   0  275  621  56  7  1 92
 0 4 0   47896 13152   20   0   0   0   0   0   1   0  253  471  46  6  1 93
 1 4 0   47492 13372   18   0   0   0  64   0   0   0  251  478  43  0  1 99
 0 4 0   47492 13372    4   0   0   0   0   0   0   0  235  440  40  0  0 100
 0 4 0   47492 13372    4   0   0   0   0   0   0   0  238  442  40  0  2 98

The CPU time drop from 80 all the way to zero and make the Apache hang for like 30 
seconds and the resume back again.  It happens VERY often if I only have like 30 users 
surf the website at the same time.  It pretty much bring the web server down if I have 
around 50 users surft the site

Previous Comments:
---------------------------------------------------------------------------

[2001-04-11 18:03:59] [EMAIL PROTECTED]
I am running on FreeBSD 4.2 Stable, Apache 1.3.19 + PHP 4.0.4pl1 + Modssl on a Dual P2 
400mhz with 256mb ram.  From time to time, one of the httpd process will eat up all 
the CPU time and memory, and after around 5 to 10 seconds, it goes back to normal  
Even a Very simple script like

<? 
echo "test";
?>

can make it happen. 1 out of 25 reload of the above script can make the spike happen.  
But the web server do not crash though.  If I run on a script with heavy database 
access, it happen 1 out of 10 if I press reload button continously.

BTW, is that normal for Apache to take up 30% of the CPU time to excute one single 
PHP-database-driven page?

I search the bugs database and I found another user have the exact problem like what I 
am having right now.  His bug id is #9154.

This is how I configure PHP
./configure  --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs 
--with-config-file-path=/usr/local/etc --enable-track-vars --enable-ftp  
--with-gd=/usr/local --with-pcre-regex=/usr/local/ 
--with-jpeg-dir=/usr/local --with-xpm-dir=/usr/X11R6

With or Without modssl enable does not make a difference.  Both can cause the spike.

---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=10299


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to