Answer the question
In order to leave comments, you need to log in
How to increase the limits of open files (sockets) for a go program?
The following errors are thrown in the go log
2017/03/08 08:11:11 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 5ms
2017/03/08 08:11:11 http: Accept error: accept tcp [::]:9001: accept4: too many open files; retrying in 10ms
Actually in limits.conf
* soft nproc 200000
* hard nproc 200000
* soft nofile 200000
* hard nofile 200000
ulimit -n
200000
in sysctl.conf
fs.file-max = 99999999
but when I look at the limits on the app itself for some reason there is 1024 soft and 4048 hard
cat /proc/26602/limits
Limit Soft Limit Hard Limit Units
Max open files 1024 4096 files
How to increase the application limit?
Answer the question
In order to leave comments, you need to log in
As a result, it turned out that this is a default restriction that is imposed by systemd
In the service startup script, you need to prescribe
LimitNOFILE=200000
LimitNPROC=200000
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question