首先我想解释一下我使用该服务器的用途。
该服务器用于提供可下载文件。特别是视频游戏,我将其上传到服务器,然后用户可以通过表单操作下载。以下是请求下载文件的来源链接。
我面临的问题是,我有一台 Intel Core i7 8 核 12 GB Ram 专用服务器。每当我让用户通过服务器下载文件时,它就会开始产生高平均负载,然后服务器无法通过我为其创建的 PHP 页面获取下载。
我还附上了我的Nginx.conf
和其他人的截图,请大家看看。还有一件事:每当我重新启动 nginx 时,它都会变得非常快,尽管平均负载很高,但一分钟后又会变慢。
您可以在此处查看这是请求下载文件的来源
worldofpcgames.net/fairy-fencer-f-advent-dark-force-free-download/
这是我的 NGINX->
user nginx;
worker_processes 8;
worker_rlimit_nofile 5000;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 3000;
use epoll;
multi_accept on;
}
http {
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;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /mnt/www/html;
index index.php;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
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$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /protected {
root /mnt/www/html;
secure_link $arg_md5,$arg_expires;
secure_link_md5 "$secure_link_expires$uri$remote_addr enigma";
if ($secure_link = "") { return 403; }
if ($secure_link = "0") { return 410; }
error_page 403 /blocked.html;
}
}
# Settings for a TLS enabled server.
#
# server {
# listen 443 ssl http2 default_server;
# listen [::]:443 ssl http2 default_server;
# server_name _;
# root /usr/share/nginx/html;
#
# ssl_certificate "/etc/pki/nginx/server.crt";
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 10m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# # Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
#
# location / {
# }
#
# error_page 404 /404.html;
# location = /40x.html {
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
# }
}
以下是 NGINX 错误日志 ->
还有一件事,我根本没有配置我的 PHP 或 Mysql。我只是安装了它们并做了一些基本设置,例如将用户和所有者组更改为 nginx。然后听
我在 Centos7 上所以请帮助我
抱歉,这里是 nginx.conf,无法链接上述内容,因为我没有声誉点 https://drive.google.com/open?id=0ByamFYoTQ6KRRFpnUWJ3VGNxUEE
答案1
问题出在您的磁盘iowait
(sdc) 上。查看您的屏幕截图中的红线atop -c
。这会导致平均负载高但 CPU 使用率低。您的 lvm 配置是什么?
更新:@MichaelHampton 在评论中先我指出了这一点。