ID: 46830
User updated by: ncross42 at cyworld dot com
Reported By: ncross42 at cyworld dot com
-Status: Open
+Status: Bogus
Bug Type: Apache2 related
Operating System: Ubuntu-8.04.1-server
PHP Version: 5.2.8
New Comment:
I have a reply from Apach maintainer.
"The php manual has comments saying sleep() wakes up when you receive
any signal
(like the traditional C library call documents, man 3 sleep)
Termination due to MaxRequestsPerchild is implemented via a signal."
So, this is not a bug. :)
Previous Comments:
------------------------------------------------------------------------
[2008-12-11 04:24:49] ncross42 at cyworld dot com
sorry again.
There is wrong expected results.
-=-= result page of 1.php =-=-
1
11:12:47
11:12:49 <- this is bug results.
-=-= result page of 2.php =-=-
2
11:12:49
11:12:49
-=-= result page of 1.php =-=-
1
11:12:47
11:12:57 <- I expected like this!! (sleeping 10 sec)
-=-= result page of 2.php =-=-
2
11:12:57 <- this value is meaningless
11:12:57 <- but for fast refresh.
------------------------------------------------------------------------
[2008-12-11 03:06:21] ncross42 at cyworld dot com
sorry, i don't submitted Actual results.
here is Actual results.
-=-= result page of 1.php =-=-
1
11:49:00
11:49:02
-=-= result page of 2.php =-=-
2
11:49:02
11:49:02
------------------------------------------------------------------------
[2008-12-11 02:57:57] ncross42 at cyworld dot com
Description:
------------
This bug is a apache-thread related php excution bug.
This bug is repeatable and clear.
1. System setting.
a. apache-2.2.10 : mpm=worker and using shared modules.
-=-=-= httpd.conf =-=-=-
for simple test, values are low.
<IfModule worker.c>
StartServers 1
MinSpareThreads 2
MaxSpareThreads 4
ThreadsPerChild 2 # <- this is important.
MaxRequestsPerChild 5 # <- this is important.
</IfModule>
b. PHP-5.2.8 : using apxs2 and enable-maintainer-zts for threadsafe
(no external cache like APC or XCache)
Reproduce code:
---------------
-=-= code of 1.php =-=-
<?php
echo '1<br>';
echo date("H:i:s").'<br>';
sleep(10);
echo date("H:i:s").'<br>';
?>
-=-= code of 2.php =-=-
<?php
echo '2<br>';
echo date("H:i:s").'<br>';
echo date("H:i:s").'<br>';
?>
Expected result:
----------------
<bug scenario>
(a) browse 1.php and 2.php <concurrently ONCE>. result are not
problem.
-=-= result page of 1.php =-=-
1
11:04:29
11:04:39
-=-= result page of 2.php =-=-
2
11:04:30
11:04:30
(b) I expected ...
- browse 1.php and 2.php
- refresh 2.php over 10 times very fast within 10 sec. (yes, using
F5)
- I expected below normal resuluts.
-=-= result page of 1.php =-=-
1
11:12:47
11:12:49
-=-= result page of 2.php =-=-
2
11:12:49
11:12:49
Actual result:
--------------
<ANALYSIS>
(a) initial apache process is here
Shell> ps ax | grep httpd
5697 ? Ss 0:00 /skcomms/apache/bin/httpd -k restart
5964 ? Sl 0:00 /skcomms/apache/bin/httpd -k restart
- becuase below apache setting
<IfModule worker.c>
StartServers 1
MinSpareThreads 2
ThreadsPerChild 2
...
</IfModule>
(b) suppose
- in (a) action, two connection is established with process 5964
- in (b) action, new 1.php is sleeping in 5964 and 2.php is excuted
in other new process because below reason.
<IfModule worker.c>
...
ThreadsPerChild 2
MaxRequestsPerChild 5
</IfModule>
(c) expected in 1.php excution time (within 10 sec)
5697 ? Ss 0:00 /skcomms/apache/bin/httpd -k restart
5964 ? Sl 0:00 /skcomms/apache/bin/httpd -k restart (1.php
is sleeping here)
597x ? Sl 0:00 /skcomms/apache/bin/httpd -k restart (2.php
is browsed here)
(d) but actually 5964 is terminated early in 2 seconds.
5697 ? Ss 0:00 /skcomms/apache/bin/httpd -k restart
5991 ? Sl 0:00 /skcomms/apache/bin/httpd -k restart
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46830&edit=1