So i have Nginx as a web server with PHP running as fastcgi what nginx
serves traffic via upstreams.
The strange bug i have encountered is the fact when i upload a large
file
lets say 2GB and PHP must pass this file to a mapped hard drive via
network
sharing. PHP/Nginx does not serve traffic to anyone until that
temp(uploaded
file) has been successfully moved to the mapped hard drive.
Does anyone know why it would be locking up like this or how to solve it
? I
don’t think it is Nginx i think it is just PHP that is locking up. But
it is
a nightmare trying to figure out how to keep it serving traffic since
there
will be 60-120 seconds while PHP is pushing this file to the mapped hard
drive that no traffic gets served and everyones pages keep loading (they
don’t time out just keep loading / waiting for first byte what is always
sent as soon as the file upload is complete.)
If it helps its latest php builds default production config and
itpp2012’s
Nginx Build.
Posted at Nginx Forum:
There is a no_buffer option for proxy you could try (see regular manual
for
correct function name).
Posted at Nginx Forum:
Hi itpp2012 thanks for the swift response :), I am not proxying to PHP
Nginx
passes the request to the fastcgi upstream Nginx + PHP are both on the
same
machine just the storage machine (the mapped hard drive) is seperate.
I did look in the docs and find this “fastcgi_buffering off;” And
“proxy_buffering off;”
http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_buffering
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering
Is that what you are referring to ?
I will give a go with those directives and reply back if it is fixed or
not.
Posted at Nginx Forum:
Those directives did not fix it.
But i decided to investigate sessions and temporary upload directory of
PHP.
Now the temporary session directory gave me the same no loading issue
until
uploads have been moved to the mapped hard drive by php.
But the following seemed to change that and actualy allow me to keep
serving
traffic with uploads being pushed to the mapped hard drive.
Inside PHP.INI
[PATH=C:/server/websites/public_www]
upload_tmp_dir=Z:/server/websites/temp-uploads
C:/ is the local machine drive where nginx + php is presant.
Z:/ is the external mapped hard drive.
Now i don’t know why that seems to fix it perhaps someone can elaborate
?
Also it comes at a cost it takes twice as long for a upload to be pushed
to
a mapped hard drive for some reason like that.
Posted at Nginx Forum:
c0nw0nk Wrote:
I did look in the docs and find this “fastcgi_buffering off;” And
“proxy_buffering off;”
Is that what you are referring to ?
Yea thats it, I knew they were there but couldn’t remember them as fast.
Posted at Nginx Forum:
Sounds like a blocking disk driver issue, look at the driver settings,
dma/pio/caching/advanced sata/etc…
Dynamic content is also best served from a different drive (virtual or
real)
then where nginx is running from.
Posted at Nginx Forum:
Thanks for the information everything is default though so i am not
sure
what i should even be changing anything to.
On the mapped hard drive “Z:/” it has the settings
Posted at Nginx Forum:
This is expected behavior if you are using PHP sessions.
See PHP: session_write_close - Manual
So its because i’m using PHP’s built in file session handler ? Should i
switch it to maybe Wincache or something ?
Posted at Nginx Forum: