We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
504 Gateway Time-out - При добавлении доменов
504 Gateway Time-out - При добавлении доменов
Добавил около 200 доменов на некоторых есть нагрузка и куча коннектов идет к серверу, решил добавить еще доменов но постоянно стала вылетать ошибка 504 Gateway Time-out
CentOS7
CentOS7
Re: 504 Gateway Time-out - При добавлении доменов
Возможно из-за высокого потребления ресурсов? Попробуйте уменьшить число сайтов на сервере.
-
- Posts: 129
- Joined: Tue Mar 08, 2016 8:03 pm
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: 504 Gateway Time-out - При добавлении доменов
Что при этом пишется в логах апача? Что показывает top или htop в момент возникновения ошибки? Что на графиках в https://IP_сервера:8083/list/rrd/ ?
Re: 504 Gateway Time-out - При добавлении доменов
Увеличить значение параметра httpd.conf
меняем до 600
nginx.conf
меняем
*ps..
Железе не слабое ?
Code: Select all
Timeout 60
nginx.conf
меняем
Code: Select all
proxy_read_timeout 120;
proxy_connect_timeout 120;
Железе не слабое ?
Re: 504 Gateway Time-out - При добавлении доменов
Dual Intel Xeon X5650 24 Core, 48 Gb RAM
Совет как то не к месту уменьшить число сайтов, до этого стояла isp но без nginx только apache там свободно держало 1000+ сайтов, сейчас что то стало уже на 200 еле грузится
Совет как то не к месту уменьшить число сайтов, до этого стояла isp но без nginx только apache там свободно держало 1000+ сайтов, сейчас что то стало уже на 200 еле грузится
Re: 504 Gateway Time-out - При добавлении доменов
Ну да, но ведь без телепатии и не догадаться, с чем имеем дело..usr999 wrote:Совет как то не к месту уменьшить число сайтов,
Что за инсинуации? Поставьте обратно платный ISP и радуйтесь жизни, попробуйте по крайней мере. Возможно это и прозвучало резко, но взаимосвязи между панелями и количеством сайтов нет и подобные намеки мне весьма неприятны. Однако естественно и то, что для большего количества сайтов на сервере стоит присмотреться к конфигурационным файлам (в данном случае вебсервера apache - поднять параметры).usr999 wrote:до этого стояла isp но без nginx только apache там свободно держало 1000+ сайтов, сейчас что то стало уже на 200 еле грузится
Re: 504 Gateway Time-out - При добавлении доменов
Как сервер поднимется я обязательно скину логи, просто я написал по поводу исп то что может быть конфиг весты по дефолту надо править иначе много сайтов не держит
Re: 504 Gateway Time-out - При добавлении доменов
nginx.conf
httpd.conf
Внесены изменения в sysctl для повышенной нагрузки
Инфу брал от сюда:
http://dak1n1.com/blog/12-nginx-performance-tuning/
https://romantelychko.com/blog/1300/
Информация о подключениях на данный момент
SpoilerShow
Server globals
user nginx;
#worker_processes 2;
worker_processes 24;
worker_rlimit_nofile 999999;
worker_priority -10;
timer_resolution 100ms;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Worker config
events {
#worker_connections 4000;
worker_connections 500000;
multi_accept on;
use epoll;
}
http {
# Main settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
#client_header_timeout 1m;
#client_body_timeout 1m;
client_header_buffer_size 2k;
client_body_buffer_size 256k;
client_max_body_size 256m;
large_client_header_buffers 4 8k;
#send_timeout 30;
send_timeout 600;
#keepalive_timeout 60 60;
keepalive_timeout 30;
keepalive_requests 200000;
reset_timedout_connection on;
server_tokens off;
server_name_in_redirect off;
server_names_hash_max_size 512;
server_names_hash_bucket_size 512;
# Log format
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format bytes '$body_bytes_sent';
#access_log /var/log/nginx/access.log main;
access_log off;
# Mime settings
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Compression
gzip on;
#gzip off;
gzip_comp_level 9;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_types text/plain text/css text/javascript
application/x-javascript application/javascript;
gzip_proxied any;
# Proxy settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffers 32 4k;
# SSL PCI Compliance
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA3$
# Error pages
error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 502 503 504 /error/50x.html;
# Cache
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m;
proxy_temp_path /var/cache/nginx/temp;
proxy_cache_key "$host$request_uri $cookie_user";
proxy_ignore_headers Expires Cache-Control;
proxy_cache_use_stale error timeout invalid_header http_502;
proxy_cache_valid any 3d;
map $http_cookie $no_cache {
default 0;
~SESS 1;
~wordpress_logged_in 1;
}
# Wildcard include
include /etc/nginx/conf.d/*.conf;
}
user nginx;
#worker_processes 2;
worker_processes 24;
worker_rlimit_nofile 999999;
worker_priority -10;
timer_resolution 100ms;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
# Worker config
events {
#worker_connections 4000;
worker_connections 500000;
multi_accept on;
use epoll;
}
http {
# Main settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
#client_header_timeout 1m;
#client_body_timeout 1m;
client_header_buffer_size 2k;
client_body_buffer_size 256k;
client_max_body_size 256m;
large_client_header_buffers 4 8k;
#send_timeout 30;
send_timeout 600;
#keepalive_timeout 60 60;
keepalive_timeout 30;
keepalive_requests 200000;
reset_timedout_connection on;
server_tokens off;
server_name_in_redirect off;
server_names_hash_max_size 512;
server_names_hash_bucket_size 512;
# Log format
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format bytes '$body_bytes_sent';
#access_log /var/log/nginx/access.log main;
access_log off;
# Mime settings
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Compression
gzip on;
#gzip off;
gzip_comp_level 9;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_types text/plain text/css text/javascript
application/x-javascript application/javascript;
gzip_proxied any;
# Proxy settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffers 32 4k;
# SSL PCI Compliance
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA3$
# Error pages
error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 502 503 504 /error/50x.html;
# Cache
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m;
proxy_temp_path /var/cache/nginx/temp;
proxy_cache_key "$host$request_uri $cookie_user";
proxy_ignore_headers Expires Cache-Control;
proxy_cache_use_stale error timeout invalid_header http_502;
proxy_cache_valid any 3d;
map $http_cookie $no_cache {
default 0;
~SESS 1;
~wordpress_logged_in 1;
}
# Wildcard include
include /etc/nginx/conf.d/*.conf;
}
SpoilerShow
ServerRoot "/etc/httpd"
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
KeepAlive Off
MaxKeepAliveRequests 1000
<Directory />
AllowOverride none
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
DirectoryIndex index.php index.html
<Files ".ht*">
Require all denied
</Files>
#ErrorLog "/dev/null"
#LogLevel warn
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
#LogFormat "%h %l %u %t \"%r\" %>s %b" common
#LogFormat "%b" bytes
#CustomLog "/dev/null" combined
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
#AddHandler cgi-script .cgi
#AddDefaultCharset windows-1251
AddDefaultCharset utf-8
<IfModule prefork.c>
StartServers 40
MinSpareServers 50
MaxSpareServers 150
ServerLimit 2600
MaxClients 2500
MaxRequestsPerChild 100000
/IfModule>
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
<IfModule remoteip_module>
RemoteIPHeader X-Real-IP
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %b" common
</IfModule>
IncludeOptional conf.d/*.conf
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
KeepAlive Off
MaxKeepAliveRequests 1000
<Directory />
AllowOverride none
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
DirectoryIndex index.php index.html
<Files ".ht*">
Require all denied
</Files>
#ErrorLog "/dev/null"
#LogLevel warn
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
#LogFormat "%h %l %u %t \"%r\" %>s %b" common
#LogFormat "%b" bytes
#CustomLog "/dev/null" combined
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
#AddHandler cgi-script .cgi
#AddDefaultCharset windows-1251
AddDefaultCharset utf-8
<IfModule prefork.c>
StartServers 40
MinSpareServers 50
MaxSpareServers 150
ServerLimit 2600
MaxClients 2500
MaxRequestsPerChild 100000
/IfModule>
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
<IfModule remoteip_module>
RemoteIPHeader X-Real-IP
LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%a %l %u %t \"%r\" %>s %b" common
</IfModule>
IncludeOptional conf.d/*.conf
Инфу брал от сюда:
http://dak1n1.com/blog/12-nginx-performance-tuning/
https://romantelychko.com/blog/1300/
SpoilerShow
net.ipv4.tcp_sack = 1
net.ipv4.tcp_mem = 8388608 12582912 16777216
net.ipv4.udp_mem = 8388608 12582912 16777216
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_no_metrics_save = 1
net.netfilter.nf_conntrack_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rfc1337 = 1
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 3240000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_congestion_control = htcp
net.core.netdev_max_backlog = 8192
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.nf_conntrack_max = 16777216
net.ipv4.ip_forward = 1
net.ipv4.tcp_max_orphans = 0
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_retries2 = 2
net.ipv4.tcp_reordering = 5
net.ipv4.tcp_retrans_collapse = 0
net.ipv4.tcp_mem = 8388608 12582912 16777216
net.ipv4.udp_mem = 8388608 12582912 16777216
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384
net.ipv4.tcp_no_metrics_save = 1
net.netfilter.nf_conntrack_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rfc1337 = 1
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 3240000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_tw_buckets = 1440000
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_congestion_control = htcp
net.core.netdev_max_backlog = 8192
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.nf_conntrack_max = 16777216
net.ipv4.ip_forward = 1
net.ipv4.tcp_max_orphans = 0
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_retries2 = 2
net.ipv4.tcp_reordering = 5
net.ipv4.tcp_retrans_collapse = 0
SpoilerShow
[root@IX-0238 ~]# netstat -tan |grep ESTA | wc -l
3231
[root@IX-0238 ~]# netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
1 CLOSE_WAIT
1249 ESTABLISHED
1 FIN_WAIT1
26 FIN_WAIT2
5 LAST_ACK
65 LISTEN
6 SYN_RECV
667 TIME_WAIT
[root@IX-0238 ~]# netstat -an | grep -c :80
10852
3231
[root@IX-0238 ~]# netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
1 CLOSE_WAIT
1249 ESTABLISHED
1 FIN_WAIT1
26 FIN_WAIT2
5 LAST_ACK
65 LISTEN
6 SYN_RECV
667 TIME_WAIT
[root@IX-0238 ~]# netstat -an | grep -c :80
10852
-
- Posts: 129
- Joined: Tue Mar 08, 2016 8:03 pm
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: 504 Gateway Time-out - При добавлении доменов
А именно в логах (/var/log/httpd/error.log ) что в момент 503-й пишется?
Re: 504 Gateway Time-out - При добавлении доменов
Сейчас случилась такая картина что домены не отображает