Hello ,
I wrote a code in php to read a file from remote server and send the content to a user , something like a proxy.
-----
----
for example if 1.rar is about 50meg , and a user have 100KB connection ,when he start to download that file , the server read that file with 10 MB speed and send it to user.That cause server to read all file and buffer it and send it to user , and get more memory.
I can't limit the script speed , because my users have different speed , but I want my script read data and wait until the data send to user and then read the next segment of data.
Is there any config in litespeed to correct this for me?
Thanks.
I wrote a code in php to read a file from remote server and send the content to a user , something like a proxy.
-----
PHP:
$fp = fsockopen('address.com', 80, $errno, $errstr);
...//some code to send headers to http://address.com/ server to get 1.rar file.
fputs($fp, $headers);
fflush($fp);
while (!feof($fp))
{
echo fgets($fp, '1024');
ob_end_flush();
}
for example if 1.rar is about 50meg , and a user have 100KB connection ,when he start to download that file , the server read that file with 10 MB speed and send it to user.That cause server to read all file and buffer it and send it to user , and get more memory.
I can't limit the script speed , because my users have different speed , but I want my script read data and wait until the data send to user and then read the next segment of data.
Is there any config in litespeed to correct this for me?
Thanks.