2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 13:47:15 +08:00

feat: 调优 OpenResty 配置

This commit is contained in:
耗子
2023-12-10 13:25:10 +08:00
parent 3a8f850a50
commit cd27c05d1c
2 changed files with 11 additions and 10 deletions

View File

@@ -98,7 +98,7 @@ func (r *OpenRestyController) ErrorLog(ctx http.Context) http.Response {
return controllers.Success(ctx, "")
}
out, err := tools.Exec("tail -n 100 /www/wwwlogs/nginx_error.log")
out, err := tools.Exec("tail -n 100 /www/wwwlogs/openresty_error.log")
if err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, out)
}
@@ -108,7 +108,7 @@ func (r *OpenRestyController) ErrorLog(ctx http.Context) http.Response {
// ClearErrorLog 清空错误日志
func (r *OpenRestyController) ClearErrorLog(ctx http.Context) http.Response {
if out, err := tools.Exec("echo '' > /www/wwwlogs/nginx_error.log"); err != nil {
if out, err := tools.Exec("echo '' > /www/wwwlogs/openresty_error.log"); err != nil {
return controllers.Error(ctx, http.StatusInternalServerError, out)
}

View File

@@ -287,10 +287,12 @@ cat > ${openrestyPath}/conf/nginx.conf << EOF
# 该文件为OpenResty主配置文件不建议随意修改
user www www;
worker_processes auto;
worker_cpu_affinity auto;
worker_rlimit_nofile 65535;
pcre_jit on;
quic_bpf on;
error_log /www/wwwlogs/openresty_error.log crit;
pid /www/server/openresty/nginx.pid;
worker_rlimit_nofile 51200;
quic_bpf on;
stream {
log_format tcp_format '\$time_local|\$remote_addr|\$protocol|\$status|\$bytes_sent|\$bytes_received|\$session_time|\$upstream_addr|\$upstream_bytes_sent|\$upstream_bytes_received|\$upstream_connect_time';
@@ -301,7 +303,7 @@ stream {
events {
use epoll;
worker_connections 51200;
worker_connections 65535;
multi_accept on;
}
@@ -309,7 +311,9 @@ http {
include mime.types;
include proxy.conf;
include default.conf;
default_type application/octet-stream;
keepalive_timeout 60;
server_names_hash_bucket_size 512;
client_header_buffer_size 32k;
@@ -321,14 +325,11 @@ http {
variables_hash_max_size 2048;
variables_hash_bucket_size 128;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
http2 on;
http3 on;
quic_gso on;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
fastcgi_connect_timeout 300;