I'm trying to serve large files (50-800mb) from a VPS using Nginx to host map files for a game server. Oddly, when downloading map files in game or in a browser I'm hitting only ~15mbps. When downloading via CURL or WGET on a separate machine (same network) I'm hitting 60mbps (my maximum). I have tried a variety of settings (sendfile on, max_chunk_size, directio, etc) without any change in behavior between them. Here is my configuration as it stands now:
user www-data;
worker_processes 2;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log /var/log/nginx/access.log main;
access_log off;
keepalive_timeout 65;
#gzip on;
#gzip_types application/octet-stream;
include /etc/nginx/conf.d/*.conf;
}
server {
listen 80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
access_log off;
root /var/www/home;
index index.html;
location / {
}
location ^~ /kf2 {
alias /var/www/kf2;
autoindex on;
}
location ^~ /img {
alias /var/www/img;
}
}
I currently have sendfile removed for testing, but having it enabled made no difference anyways. Running a download to localhost with WGET reaches speeds over 200mbps, so I don't think this is a disk I/O limitation. I'm at a loss here and can't explain the discrepancy between curl/wget and downloading via a browser. Any help is appreciated.