Edit report at http://bugs.php.net/bug.php?id=46723&edit=1
ID: 46723
Comment by: jost_boekemeier at users dot sf dot net
Reported by: jost_boekemeier at users dot sf dot net
Summary: FastCGI is incredibly slow due to TCP ack delay
Status: No Feedback
Type: Bug
Package: CGI related
Operating System: *
PHP Version: 5CVS, 6CVS (2008-12-08)
New Comment:
Please excuse the delay. I didn't noticed that you were asking for a
patch.
After applying the patch fastcgi renders 900 pages in 1m8.095s, compared
to 1m40.428s before.
[notice for me]
$ time for i in seq 900; do wget -O/dev/null -o/dev/null
http://localhost:8080/JavaBridge/sessionSharing.php;
done
real 1m40.428s
user 0m1.587s
sys 0m3.108s
$ time for i in seq 900; do wget -O/dev/null -o/dev/null
http://localhost:8080/JavaBridgeO/sessionSharing.php;
done
real 1m8.095s
user 0m1.212s
sys 0m2.485s
Previous Comments:
------------------------------------------------------------------------
[2009-01-29 01:00:16] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2009-01-21 19:27:40] jani@php.net
Patches are always welcome, you don't need to wait for a request..:)
------------------------------------------------------------------------
[2008-11-30 17:42:32] jost_boekemeier at users dot sf dot net
Description:
------------
The PHP side of a socket-based FastCGI communication is unbuffered since
PHP 5.1.4 (maybe earlier).
write/write/read cycles have a huge performance impact, on the latest
Linux kernel the FastCGI SAPI is actually slower than executing a CGI
for each request!
The actual problem is caused by the two unbuffered write() operations,
which run into a delayed ack and therefore cause a latency of 40000us on
FC10 and 500ms(!) on FreeBSD.
As an immediate fix I suggest to switch on NDELAY for the PHP FastCGI
socket communication. I can provide a patch if you want me to.
Regards,
Jost Bökemeier
Reproduce code:
---------------
-
Expected result:
----------------
-
Actual result:
--------------
-
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=46723&edit=1