High concurrency optimize for linux

Added to /etc/sysctl.conf:

 

vm.swappiness = 0vm.max_map_count = 1000000fs.file-max = 1000000# increase the port range (to allow more sockets to be opened)# net.ipv4.ip_local_port_range = 9000 65535 # if you run php fpm , should not lower than 9000# allows OS to reuse sockets in TIME_WAIT state for new connections when it is safe from a protocol viewpoint.net.ipv4.tcp_fin_timeout = 15# net.core.default_qdisc=fq  #Enable tcp bbr, required linux kernel 4.19+# net.ipv4.tcp_congestion_control=bbrfs.inotify.max_user_watches=1000000

Added to /etc/security/limits.conf:

 

*               soft    nproc           1000000*               hard    nproc           1000000*               soft    nofile          1000000*               hard    nofile          1000000

Added to /etc/pam.d/su:

 

session    required   pam_limits.so

 

Post: 1553576089

Views: 481

Follow me: @twitter @github
Scan QR code and Donate me via alipay:
donate me via alipay
Donate me Bitcoin:136MYemy5QmmBPLBLr1GHZfkES7CsoG4Qh
Powered by GoSense RSS