Martin Mandl wrote:
Dear Ladies and Gentlemen,
the last couple of days I browsed the internet for the answer of a
questions which seems to be a common problem ... but found now real
solution:
I would like to serve large files (>100MB) to my clients using php:
while (moreDataAvailable()) {
printChunk(getChunk());
flush();
waitToReduceBandwidth();
}
Normally that works fine. However when the client has a slower internet
connection than I set using waitToReduceBandwidth() the output of the
php script builds up in the buffer of Apache. ... and the Apache process
reaches a couple of hundred MBytes ...
A solution would be to reduce the bandwidth so that is even lower than
the slowest connection ... but then clients with faster connections
would complain ...
Therefore (finally) here come the questions:
Is there a way to control the output speed of the php script according
to the actual download speed between the browser and the server?
Or is there a way to monitor the memory usage of the apache process (to
slow down the data output when it increases)?
Or is writing my own socket to act as web server a solution (is it
possible to monitor the connection speed this way)?
Or what should I do else?
Any hints are welcome, cheers
Martin
Try apaches' SendBufferSize config directive
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php