-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set a high default open files setting in init script. #916
Set a high default open files setting in init script. #916
Conversation
Does this work for you @derSascha ? Unfortunately in https://github.com/derSascha/influxdb/blob/default-max-open-files-in-init-script/scripts/init.sh#L100 start-stop-daemon is used. So unless the behavior changed your ulimit -n should have no effect. |
Works well on Ubuntu 12.04.5 LTS. Why shouldn't this work with start-stop-stop daemon? Unfortunately start-stop-daemon does not evaluate limits.conf settings and using ulimits this way seems to be a common approach. See http://superuser.com/questions/454465/make-ulimits-work-with-start-stop-daemon/459183#459183 |
@derSascha Actually start-stop-daemon has nothing to do with Like you need this in session required pam_limits.so Unfortunately most of what Elasticsearch does also expects PAM to load the limits.conf as well. A non-root user cannot elevate the open files past the hard limit (if i recall) and really we should not be running influxdb as root. It's quite a pain in the butt to get limits to be honored properly without having PAM load it up. Maybe a /etc/pam.d for influxdb that matches with start-stop-daemon so we can do this without modifying distro files? Edited to make the right pam declaration. |
@damm I didn't change any limits.conf in my commit, i simply set require limits as root at runtime and it works great :-) So why change any pam configuration here? Basic idea was:
The following works well too:
No distro files have to be changed and we can run influxdb as non root user as usual.
What do you mean with this? Have you tested it? It works perfectly on ubuntu! |
@derSascha you set it with pam so it works out of the box without any shennigans such as (ulimit) Personally I wish people would try and configure limits.conf (or limits.d) than use work arounds as having it work always is awesome. If someone slips up and starts it by hand it still works right.
|
@damm i don't change any pam settings! My limits.conf is empty (contains only comments). Running influxdb without the unlink addition results in "to many open file errors". Adding the ulimit line (this pull-request) works fine. Pleas read: http://superuser.com/questions/454465/make-ulimits-work-with-start-stop-daemon/459183#459183 According to this post, it is IMPOSSIBLE to configure start-stop-daemon limits via pam configuration. I don't understand what you mean. Do you know any tricks how to configure start-stop-daemon limits via limits.conf? |
@derSascha my experience is opposite. You cannot get start-stop-daemon to honor limits without pam and limits.conf. Really what it comes down to is we need a proper debian package that can enable whatever bits it needs to be fully working (out of the box). It's been said time and time again. You can find the latest in #816 P.S. I think I know start-stop-daemon fairly well; I'm not flawless. But hoping that ulimits are honored (and passed) is hoping for the best. In my personal experience I've done it time and time again only to find my limits are not being honored. But really this should be handled in #816 with preseeding and other bits. |
This commit sets 32768 as a default open file limit in current shell env and should be better than the default distributions settings (e.g. default on ubuntu 12.04 is 1024).