Limit for open descriptors
I'm writing a demon to go using http://github.com/sevlyar/go-daemon ♪ The question is:
What's the limit, by default, to the number of open descriptors to go? How do you change it? Are there any generally accepted recommendations on their number?
Starting at check.
ulimit -aHin shell' before By launching your demon. It's gonna be quick to show the current soft and second challenge to the hardest restrictions. Help
ulimitIt is possible to remove soft restrictions to the limits of rigidity. It should be understood that
ulimitChanges only current limits, silk and all programmes launched in the silla, so after the session or even another window of terminals, the values will remain unchanged.
The next place of limitation, this time, permanent, is
/etc/security/limits.d/The restriction is called
nofile♪ Reading (and sometimes watch) these files can only be a super-user. There are restrictions on individual users or groups used for the entire session of the user or all users of a given group.
And finally, there's a system restriction imposed through sysctl - that's it.
/sbin/sysctl -n fs.nr_open
He matches the file.
Programmatically manipulating the current process limits within the limits of the severe restrictions assigned to the session is carried out through challenges http://linux.die.net/man/3/getrlimit / http://linux.die.net/man/3/setrlimit which can be called from Go using FFI (see examples, n-p, https://stackoverflow.com/questions/2740315/how-do-i-call-c-from-go-using-the-foreign-function-interface )