Welcome! Log In Create A New Profile

Advanced

NGINX I/O synchronous downloads

Posted by polikooo 
NGINX I/O synchronous downloads
September 30, 2013 04:04PM
Hello,

I wrote a PHP script based on php fsockopen.
http://php.net/manual/fr/function.fsockopen.php
With this I'm making remote download, it means that my script download and imediately resend the received content to the client through my socket.
I had been for a while on Apache but become reliable sometime due to the load I recently made the choice to work with nginx+php-fpm.
However I'm facing an issue:
First of all my download was not synchronous it means that my server download speed was faster as the client connection of course, it means if my client has a 10mbps connection my server will download at 100mbits and there is a waste of bandwith.
After research I found that fastcgi_max_temp_file_size disabled could solve the issue and it worked.
The bandwith seems almost synchronous as my observation show, and also the file attached.
But I have still some difference which could be annoying if I have a lot of traffic arround 400mbps or more continuously.
I note a diference of 750 to 900Gb on a 10To I/O of traffic in total
For example almost 1To of difference in the file attached.
So I search and found proxy_max_temp_file_size which also been turn to 0 but I'm not sure for this one.
I also turn off proxy_buffering.
Tell me if I am wrong for what I want to do.
Could you give me some advice to make the remote more synchronous like Apache make.

Thanks in advance for your help.
Attachments:
open | download - daily.png (50 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 251
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready