Nginx:多次下载冻结我的服务器

时间:2017-11-22 22:49:49

标签: nginx

我们遇到Nginx问题。我们有一个转换器服务器它将MP4视频转换为MP3文件和300个用户在线,所以当他们开始同时下载他们的MP3文件时,服务器时间响应变得如此巨大,就像它被冻结一样,即使%vCPU没有&当他使用mpeg库开始转换时,#39; t超过10%。

我的服务器配置:

16 vCPU.
RAM:30G
Data transfert :5TB.

Nginx配置(nginx.conf)

user www-data;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

worker_rlimit_nofile 20240;

events {
    worker_connections  4000;

    multi_accept on;
    use epoll;
}

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  off;

    limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;

    server_tokens off;

    client_header_timeout 10m;
    client_body_timeout 10m;
    send_timeout 10m;

    client_max_body_size 700m;
    connection_pool_size 256;
    client_body_buffer_size 1024k;
    client_header_buffer_size 8k;

    keepalive_timeout 30;
    keepalive_requests 100000;
    reset_timedout_connection on;
    open_file_cache max=200000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;

    gzip on;
    gzip_min_length 10240;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
    gzip_disable "MSIE [1-6]\.";

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

    #include /etc/nginx/conf.d/*.conf;
}

网站nginx配置:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /var/www/html;
    index index.php index.html index.htm;

    client_max_body_size 700m;
    connection_pool_size 256;
    client_body_buffer_size 1024k;
    client_header_buffer_size 8k;


    limit_rate 125k;
    limit_req zone=one burst=5;


    # Make site accessible from http://localhost/
    server_name localhost;

    location / {

        try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

}

你知道问题出在哪里吗?

0 个答案:

没有答案