Report open too many files error during node operation
as the picture shows:

Reason
At some point, the database server or application may report an error due to too many open files (too many open files). In most cases, this is due to configuration parameters that are too small to meet the needs of the application.
Solution
1. Edit limits.conf
$ sudo su
$ vi /etc/security/limits.conf
Put the following content in the file
root soft nofile 1000000
root hard nofile 1000000
\* soft nofile 1000000
\* hard nofile 1000000
2. Set sysctl.conf
$ mv /etc/sysctl.conf /etc/sysctl.conf.bak
$ vi /etc/sysctl.conf
Put the following into /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
the
vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce=2
net.ipv4.conf.lo.arp_announce=2
net.ipv4.conf.all.arp_announce=2
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2
the
net.core.wmem_default=8388608
net.core.rmem_default=8388608
the
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_no_metrics_save = 1
the
net.core.netdev_max_backlog=262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_max_tw_buckets = 60000
net.ipv4.ip_local_port_range = 1024 65000
the
net.ipv4.tcp_fin_timeout = 5
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_retries1 = 2
net.ipv4.tcp_retries2 = 10
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
the
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_keepalive_time = 10
fs.file-max = 1000000
the
net.core.somaxconn=65535
the
kernel.kptr_restrict=1
Re-execute
$ sysctl -p # run to take effect
$ systemctl restart docker
3. View Results
$ ulimit -a # Enter again to view