I have a file on my tiny server (BeagleBoneBlack) which I want to download to another machine. Therefore I try to do it via PHP from my nginx-web-server. The file size is about 1.2 GB and the download always stops at about 410MB.
Since both computers are behind the same switch I wouldn't see a connection problem. Additionally I can rule out the possibility of software issues, cause I tested it with different PHP-software and the same problem occurs. Downloading via SCP works without a problem.
During download via PHP I see in the /proc/loadavg
values like
3.15 1.17 0.46 1/95 1163
3.15 1.17 0.46 1/95 1164
3.14 1.20 0.48 1/95 1165
3.14 1.20 0.48 1/95 1166
3.21 1.25 0.50 1/95 1167
3.21 1.25 0.50 1/95 1168
3.21 1.25 0.50 1/95 1169
3.44 1.43 0.57 1/95 1172
3.42 1.52 0.61 2/95 1175
3.42 1.52 0.61 1/95 1178
and would assume that the load is quite high. Therefore I suspect the nginx-config which doesn't really fit the tiny server its running on. My nginx.conf
looks like:
user www-data;
worker_processes 1;
#worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Could anybody give me a hint why I cannot download bigger files ? Resp. what to change?
UPDATE:
Since I get *466 writev() "/var/lib/nginx/fastcgi/1/00/0000000001" has written only 1498 of 8184 while reading upstream, client:
in the nginx error-log I paste as well the config-settings for fastcgi_params
:
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;