运行jar 配置 参考
java -jar server.jar -Xms6.5g -Xmx6.5g -xx:NewSize=5.5g -xx:MaxNewSize=5.5g -XX:MaxDirectMemorySize=1g
单个JVM下支撑100w线程数vm.max_map_count
sysctl -w vm.max_map_count=262144
持久性的做法是在 /etc/sysctl.conf 文件中修改 vm.max_map_count 参数
echo "vm.max_map_count=262144" > /etc/sysctl.conf
sysctl -p
修改完后需要重启 linux系统
$ ulimit -n
$ vim /etc/security/limits.conf
# 下面包括 * 号都要写入
* hard nofile 1000000
* soft nofile 1000000
# 查看
$ cat /proc/sys/fs/file-max
# 修改
$ vim /etc/sysctl.conf
# 加入
fs.file-max=1000000
sysctl.conf 和 limits.conf 学习和调优 | HelloDog
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=100
vm.swappiness=1
net.ipv4.ip_local_port_range=10000 65001
net.ipv4.tcp_max_orphans=4000000
net.ipv4.tcp_timestamps=0
net.core.somaxconn=1024
net.netfilter.nf_conntrack_max=121005752
kernel.core_pattern=/var/coredump/core.%e.%p.%t