|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #35879 Low performance for fpassthru()
Submitted: 2006-01-03 10:32 UTC Modified: 2016-08-14 04:22 UTC
From: sentomas at hotmail dot com Assigned: cmb (profile)
Status: No Feedback Package: *General Issues
PHP Version: 5.1.1 OS: FBSD/LINUX/UNIX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sentomas at hotmail dot com
New email:
PHP Version: OS:


 [2006-01-03 10:32 UTC] sentomas at hotmail dot com
I was trying to use fpassthru to runing a fileservice web host. 
But when the web server request at a large scale, like 100 more requests for different files at same time. The fpassthru() bring the server load up to 30 even 150, and OS have to use large amount swap to fullfill the buffer request from fpassthru(). Which we all know its extrem high for unix system.

We all know unix provide an easy way to output file data via sendfile() which avoid resouce copy between users but direct cope filepoint to socket. 

I know its might be diffcult to oprerate on webserver socket from PHP as FCGI or mod. But I really hope there is another way to improve fpassthru() to some real large scale usage. Otherwise I have to rewrite a httpd by myself to server for dymatic file service request. :(


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-04 17:24 UTC]
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2016-08-04 17:24 UTC]
Does this issue still persist? PHP 5.1.1 has been quite a while

BTW: can't you use readfile()?
 [2016-08-14 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 10:01:31 2024 UTC