• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

cannot handle more then 4K connections

MhNi

New Pleskian
Hi

I have 3.2 Ghz 4 core processor with 16 GB ram, when ever i got 4000 simultaneous connections on my website it shows 504 Bad gateway error some times it shows 502 Time Out, and behind this 'ngnix' is written, i have installed plesk 12.5 and it install apache, ngnix with php-fpm by default. I am not sure if my site is on pure apache or mix of ngnix, thats i think php-fpm.

other hand, same time, my plesk panel work fine faster as usual, but sites get slow down. I want ask... If it is ngnix settings issue or its server issue

but if server issue, then plesk must also get slower or show time out error, but it is not
 
Actually, many different reasons of these errors may be there. To find the cause, it is necessary to make a detailed investigation of the problem. Examine the logs, try different solutions from KB articles, etc. Have you tried to find solutions in KB articles at least?
 
I have readout all articles and do many changes, like see in nginx.conf i added

worker_processes 8;
events {
worker_connections 8048;
multi_accept on;
}

in http section

fastcgi_buffers 32 512k;
fastcgi_buffer_size 1024k;


and in php-fpm.d/site.d

pm = ondemand
pm.max_children = 5
pm.process_idle_timeout = 10s
; Following pm.* options are used only when 'pm = dynamic'
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 1

php_value[max_execution_time] = 150

and for server, in sysctl

# Use the full range of ports.
net.ipv4.ip_local_port_range = 1024 65535

# Enables fast recycling of TIME_WAIT sockets.
# (Use with caution according to the kernel documentation!)
net.ipv4.tcp_tw_recycle = 1

# Allow reuse of sockets in TIME_WAIT state for new connections
# only when it is safe from the network stack’s perspective.
net.ipv4.tcp_tw_reuse = 1

#
# 16MB per socket - which sounds like a lot, but will virtually never
# consume that much.
#
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216

# Increase the number of outstanding syn requests allowed.
# c.f. The use of syncookies.
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_syncookies = 1

# The maximum number of "backlogged sockets". Default is 128.
net.core.somaxconn = 1024

kernel.sched_migration_cost_ns = 5000000

kernel.sched_autogroup_enabled = 0
 
Back
Top