Bug #18221 Updated: Massive slowdown in fwrite() when not printing any text
| From: | rca at spin dot ch | Date: | Tue, 09 Jul 2002 08:46:09 +0000 |
| Subject: | Bug #18221 Updated: Massive slowdown in fwrite() when not printing any text | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13573@lists.php.net to get a copy of this message | ||
ID: 18221
Updated by: rca@spin.ch
Reported By: rca@spin.ch
-Status: Bogus
+Status: Open
Bug Type: Filesystem function related
Operating System: Linux 2.2.16
-PHP Version: 4.1.2
+PHP Version: 4.2.1
New Comment:
Also tested this in 4.2.1 on the same Apache/Linux combination. It's
still a bug.
Previous Comments:
------------------------------------------------------------------------
[2002-07-08 06:08:29] derick@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
------------------------------------------------------------------------
[2002-07-08 06:07:28] rca@spin.ch
Try the following code snippet on its own page:
$filename = "foo.txt";
$content = "blah";
$fd = fopen($filename, "a");
fwrite($fd, $content);
fwrite($fd, "\n");
fclose($fd);
You'll notice that the file is created just as intended, but the
browser will be left waiting for data for a LONG time. However, if you
add this to the end of the script:
print "test";
The page is finished and sent to the browser immediately, no delays at
all.
This was found by one of our students, not by me :)
Verified on PHP 4.1.2 using Apache 1.3.12 and 1.3.20, the former on
kernel 2.2.16, the latter 2.4.2.
PHP configure line: './configure' '--with-png-dir=/usr'
'--with-mysql=/usr/local/mysql' '--with-apxs' '--with-swf=/usr/lib/
swf' '--with-config-file-path=/etc/httpd/php.ini' '--enable-ftp'
'--with-gd=/usr/' '--with-jpeg-dir=/usr' '-- with-ttf'
'--with-zlib'
'--with-t1lib' '--with-ming'
'--with-config-file-path=/etc/httpd/php.ini' '--enable- trans-sid'
'--with-imap' '--with-imap-ssl=/usr/include/openssl'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18221&edit=1