nginx linux下载文件,linux – 从nginx缓慢下载大型静态文件

我在vmware-esxi虚拟化中使用debian 7 x64.

每个客户端的最大下载量为1mb / s,Nginx一起使用不超过50mbps,我的问题是什么可能导致传输速度变慢?

服务器

**Settings for eth1:

Supported ports: [ TP ]

Supported link modes: 1000baseT/Full

10000baseT/Full**

root@www:~# iostat

Linux 3.2.0-4-amd64 (www) 09.02.2015 _x86_64_ (4 cpu)

avg-cpu: %user %nice %system %iowait %steal %idle

1,75 0,00 0,76 0,64 0,00 96,84

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn

sda 173,93 1736,11 219,06 354600 44744

root@www:~# free -m

total used free shared buffers cached

Mem: 12048 1047 11000 0 106 442

-/+ buffers/cache: 498 11549

Swap: 713 0 713

user www-data;

worker_processes 4;

pid /var/run/Nginx.pid;

events {

worker_connections 3072;

# multi_accept on;

}

http {

##

# Basic Settings

##

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 5;

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;

## Start: Size Limits & Buffer Overflows ##

client_body_buffer_size 1k;

client_header_buffer_size 1k;

client_max_body_size 4M;

large_client_header_buffers 2 1k;

## END: Size Limits & Buffer Overflows ##

## Start: Timeouts ##

client_body_timeout 10;

client_header_timeout 10;

send_timeout 10;

## End: Timeouts ##

## END: Size Limits & Buffer Overflof

##

# 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/*;

}

/etc/sysctl.conf中

# Increase system IP port limits to allow for more connections

net.ipv4.ip_local_port_range = 2000 65000

net.ipv4.tcp_window_scaling = 1

# number of packets to keep in backlog before the kernel starts dropping them

net.ipv4.tcp_max_syn_backlog = 3240000

# increase socket listen backlog

net.core.somaxconn = 3240000

net.ipv4.tcp_max_tw_buckets = 1440000

# Increase TCP buffer sizes

net.core.rmem_default = 8388608

net.core.rmem_max = 16777216

net.core.wmem_max = 16777216

net.ipv4.tcp_rmem = 4096 87380 16777216

net.ipv4.tcp_wmem = 4096 65536 16777216

更新:

调试日志完全为空,只有当我手动取消下载时才会出现以下错误

2015/02/09 20:05:32 [info] 4452#0: *2786 client prematurely closed connection while sending response to client,client: 83.11.xxx.xxx,server: xxx.com,request: "GET filename HTTP/1.1",host: "xxx.com"

卷曲输出:

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 1309M 100 1309M 0 0 374M 0 0:00:03 0:00:03 --:--:-- 382M

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值