Fixing elasticsearch “max number of threads for user is too low” with systemd

Using overrides

Warning

This post was written more than 5 years ago, and its contents may be out of date

If you’ve installed elasticsearch from repos and running it via systemd, you may see, that it will not catch up limits from /etc/security/limits.conf. You can easily override it using systemd:

  1. Create folder /etc/systemd/system/elasticsearch.service.d/
  2. Then create file override.conf in that folder with the following contents:
[Service]
LimitNPROC=2048
  1. Reload daemons: systemctl daemon-reload
  2. Restart elastic: systemctl restart elasticsearch

Now changes will remain even if you’ll update elastic via package manager (which will recreate service file).

Licensed under CC BY-NC 4.0

Comments