Nginx обеспечивает скорость загрузки данных не соответствует тесту iperf3 - PullRequest
0 голосов
/ 29 января 2019

Я использую iperf3 для проверки IP, там получается 9.3G / s

[root@localhost ~]# iperf3 -c 4.4.226.59
Connecting to host 43.224.226.59, port 5201
[  4] local 4.4.226.69 port 57212 connected to 4.4.226.59 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  1.07 GBytes  9.23 Gbits/sec   33    700 KBytes       
[  4]   1.00-2.00   sec  1.09 GBytes  9.41 Gbits/sec    0    721 KBytes       
[  4]   2.00-3.00   sec  1.10 GBytes  9.41 Gbits/sec    0    747 KBytes       
[  4]   3.00-4.00   sec  1.09 GBytes  9.41 Gbits/sec   61    672 KBytes       
[  4]   4.00-5.00   sec  1.10 GBytes  9.42 Gbits/sec    0    721 KBytes       
[  4]   5.00-6.00   sec  1.10 GBytes  9.42 Gbits/sec    3    656 KBytes       
[  4]   6.00-7.00   sec  1.10 GBytes  9.42 Gbits/sec    0    706 KBytes       
[  4]   7.00-8.00   sec  1.09 GBytes  9.41 Gbits/sec    0    734 KBytes       
[  4]   8.00-9.00   sec  1.10 GBytes  9.42 Gbits/sec    0    752 KBytes       
[  4]   9.00-10.00  sec  1.10 GBytes  9.42 Gbits/sec    0    766 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  10.9 GBytes  9.39 Gbits/sec   97             sender
[  4]   0.00-10.00  sec  10.9 GBytes  9.39 Gbits/sec                  receiver

, но я использую nginx для предоставления data.tar по http, там загрузка занимает только

[root @ localhost ~] # wget http://4.4.226.59:888/data.tar --2019-01-29 08: 16: 55-- http://4.4.226.59:888/data.tar подключение 4.4.226.59:888 ... подключено。 отправлено HTTP-запрос , отвечает... 200 OK длина : 6555883520 (6.1G) [приложение / поток октетов] сохранение: «data.tar.1»

43% [==============>] 2 820 689 557 517 МБ / с осталось 7 с ^ C

как мне улучшить скорость загрузки http?

ниже приведен мой конфиг nginx:

user  www www;
worker_processes auto;
error_log  /www/wwwlogs/nginx_error.log  crit;
pid        /www/server/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;

events
    {
        use epoll;
        worker_connections 5120000;
        multi_accept on;
    }

http
    {
        include       mime.types;
        #include luawaf.conf;

        include proxy.conf;

        default_type  application/octet-stream;

        server_names_hash_bucket_size 51200;
        client_header_buffer_size 3200k;
        large_client_header_buffers 4 32k;
        client_max_body_size 5000m;

        sendfile   on;
        tcp_nopush on;

        keepalive_timeout 600;

        tcp_nodelay on;

        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;
        fastcgi_intercept_errors on;

        gzip on;
        gzip_min_length 1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
        gzip_disable   "MSIE [1-6]\.";

        limit_conn_zone $binary_remote_addr zone=perip:10m;
        limit_conn_zone $server_name zone=perserver:10m;

        server_tokens off;
        access_log off;

server
    {
        listen 888;
        server_name www.bt.cn;
        index index.html index.htm index.php;
        root  /www/server/phpmyadmin;

        #error_page   404   /404.html;
        include enable-php.conf;

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /www/wwwlogs/access.log;
    }
include /www/server/panel/vhost/nginx/*.conf;
}
...