我有一台具有i5 CPU和32 Gig RAM的服务器。我上面有Plesk,所以我安装了nginx而不是Apache。我从Bluehost上的VPS服务器(具有cpanel,因此有Apache)上迁移了一个系统,该系统运行正常,除了规格有限且成本较高。我以为我可以在专用服务器上获得更好的性能,但是我的经验一直很差。我大约有7000个用户需要访问服务器上的系统,所有这些用户都进行相对较大的数据库操作(在MariaDB 10.3上)。当用户访问的列表大于3000行时,服务器会给出nginx 502错误的网关错误,而任何其他尝试访问它的用户都会收到504错误。我一直在尝试对nginx.conf文件进行更改,以查看是否可以改善但没有运气。这是我当前的设置:
#user nginx;
worker_processes 4;
#worker_connections 2048;
#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
#pid /var/run/nginx.pid;
include /etc/nginx/modules.conf.d/*.conf;
events {
worker_connections 4096;
}
http {
include 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;
sendfile on;
#tcp_nopush on;
client_body_buffer_size 40K;
client_header_buffer_size 10k;
client_max_body_size 128m;
large_client_header_buffers 4 10k;
proxy_buffering off;
#keepalive_timeout 0;
keepalive_requests 100;
keepalive_timeout 72;
client_body_timeout 90;
client_header_timeout 90;
send_timeout 60;
proxy_send_timeout 1200s;
proxy_read_timeout 1200s;
fastcgi_send_timeout 1200s;
fastcgi_read_timeout 1200s;
#gzip on;
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
server_tokens off;
include /etc/nginx/conf.d/*.conf;
}
# override global parameters e.g. worker_rlimit_nofile
include /etc/nginx/*global_params;
有人知道我在想什么或做错了吗?