Прошу помощи, уже не знаю куда копать !Сервак HP на Debian 8, 12 GB , CPU CPU E5-2420 6+6, 5 RAID,
Софт Apache2.4 + nginx/1.6.2
CMS Битрикс
Канал 1GB
Рекомендации по настройки ядра на соединения делал.
net.core.netdev_max_backlog = 10000
net.core.somaxconn = 262144
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_max_tw_buckets = 720000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_probes = 7
net.ipv4.tcp_keepalive_intvl = 30
net.core.wmem_max = 33554432
net.core.rmem_max = 33554432
net.core.rmem_default = 8388608
net.core.wmem_default = 4194394
net.ipv4.tcp_rmem = 4096 8388608 16777216
net.ipv4.tcp_wmem = 4096 4194394 16777216
Проблемы с ошибкой "Ожидание сокета или просто ожидание соединения" происходят при 2000-2500 соединений TIME_WAIT + Established в куче. По портам 80 8080 примерно около 1000-1200,
В момент падения
Оперативки 2-3 GB free
CPU 3-5 ( для него это норм)
В логах Apache всё ОК.
В nginx:
2016/03/30 17:54:40 [alert] 20206#0: *2874 open socket #106 left in connection 79
2016/03/30 17:54:40 [alert] 20206#0: *2894 open socket #109 left in connection 82
2016/03/30 17:54:40 [alert] 20206#0: *2895 open socket #110 left in connection 83
2016/03/30 17:54:40 [alert] 20206#0: *2900 open socket #111 left in connection 84
2016/03/30 17:54:40 [alert] 20206#0: *2901 open socket #112 left in connection 85
---------------------
netstat куча соединений
cp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48253
tcp CLOSE-WAIT 0 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48592
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:47720
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:47822
tcp CLOSE-WAIT 533 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:49098
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48224
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:47758
tcp CLOSE-WAIT 541 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48951
tcp CLOSE-WAIT 0 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48606
tcp CLOSE-WAIT 0 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48575
tcp ESTAB 693 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:49277
tcp ESTAB 590 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:49811
tcp CLOSE-WAIT 2084 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48750
tcp CLOSE-WAIT 532 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48866
tcp CLOSE-WAIT 0 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48628
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:47791
tcp CLOSE-WAIT 0 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48616
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48517
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48516
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:47788
tcp CLOSE-WAIT 1 0 ::ffff:127.0.0.1:http-alt ::ffff:127.0.0.1:48207
tcp ESTAB 311 0
-------------------------------------
Вот конфиг
user www-data;
error_log /var/log/nginx/error.log ;.
worker_processes 8;
pid /run/nginx.pid;
events {
<------>worker_connections 4000;
<------> multi_accept on;
use epoll;
}
http {
<------>##
<------># Basic Settings
<------>##
<------>sendfile on;
<------>tcp_nopush on;
<------>tcp_nodelay on;
reset_timedout_connection on;
........
keepalive_requests 1000;
<------>keepalive_timeout 30;
#Razmer vnut tablici
<------>types_hash_max_size 2048;
# Ne pok vers ngenix
<------>server_tokens off;
#TIME OUT
client_header_timeout 20;
client_body_timeout 20;
send_timeout 20;
<------># server_names_hash_bucket_size 64;
<------># server_name_in_redirect off;
<------>include /etc/nginx/mime.types;
<------>default_type application/octet-stream;
<------>##
<------># SSL Settings
<------>##
....
<------>ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
<------>ssl_prefer_server_ciphers on;
<------>##
<------># Logging Settings
<------>##
<------>access_log /var/log/nginx/access.log;
<------>error_log /var/log/nginx/error.log;
<------>##
<------># Gzip Settings
<------>##
<------>gzip on;
<------>gzip_disable "msie6";
> gzip_vary on;
gzip_min_length 10240;
#Razr sgatie dlya vsex
<------>gzip_proxied any;
<------>gzip_comp_level 3;
gzip_buffers 16 8k;
<------>gzip_http_version 1.1;
<------>gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text
------------------------------------
apache
<IfModule mpm_prefork_module>
<------>StartServers<--> 20
<------>MinSpareServers><------> 20
<------>MaxSpareServers><------> 80
<------>MaxRequestWorkers<-----> 1000
<------>MaxConnectionsPerChild 2500
#</IfModule>