# Docs: nofile or nproc?

**URL:** https://discuss.elastic.co/t/docs-nofile-or-nproc/142049
**Category:** Elasticsearch
**Created:** [July 28, 2018, 11:25pm UTC](https://discuss.elastic.co/t/docs-nofile-or-nproc/142049 "2018-07-28T23:25:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![joaociocca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joaociocca/32/15827_2.png) [@joaociocca](https://discuss.elastic.co/u/joaociocca)
#### Post date: [July 28, 2018, 11:25pm UTC](https://discuss.elastic.co/t/docs-nofile-or-nproc/142049/1 "2018-07-28T23:25:36Z")

</div>

On this thread

> [@After adding "elasticsearch - nofile 65536" still not enough threads are allocated](https://discuss.elastic.co/t/after-adding-elasticsearch-nofile-65536-still-not-enough-threads-are-allocated/74796):
>
> Hi everyone, I am getting an error "max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]" I opened [this](https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html#limits.conf) manual and tried the following: After trying: "sudo su ulimit -n 65536 su elasticsearch " I get an error: "This account is currently not available." After trying to add "elasticsearch - nofile 65536" to /etc/security/limits.conf the problem doesnt move. After trying to add "[Service] LimitMEMLOCK=infinity" to "/etc/systemd/system/elastic…

@jasontedor pointed that the user wants "nproc" instead of "nofile", but the documentation says "nofile", here [Configuring system settings | Elasticsearch Guide [master] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/master/setting-system-settings.html#limits.conf)

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [July 29, 2018, 12:17am UTC](https://discuss.elastic.co/t/docs-nofile-or-nproc/142049/2 "2018-07-29T00:17:14Z")

</div>

Hi! In the thread that you reference, the reporter is having trouble with the number of threads that the `elasticsearch` user can create:

> [@After adding "elasticsearch - nofile 65536" still not enough threads are allocated](https://discuss.elastic.co/t/after-adding-elasticsearch-nofile-65536-still-not-enough-threads-are-allocated/74796/1):
>
> I am getting an error "max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]"

This message is arising from the [maximum number of threads bootstrap check](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/max-number-threads-check.html). For Elasticsearch not running under `systemd` as a service, this limit is controlled by the `nproc` limit. This is why I refer the user to `nproc` there.

However, the page that you refer to regarding `nofile` is referring to a different issue. Namely the fact that the `elasticsearch` user also needs the ability to have a lot of file descriptors open. This is covered in the [file descriptor bootstrap check](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/_file_descriptor_check.html). For Elasticsearch not running under `systemd` as a service, this limit is controlled by the `nofile` limit.

In short: the issue the user is running into is different than the situation covered by the docs that you link to.

I hope that helps!

---

<div class="post-metadata">

### Author: ![joaociocca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joaociocca/32/15827_2.png) [@joaociocca](https://discuss.elastic.co/u/joaociocca)
#### Post date: [July 29, 2018, 12:35am UTC](https://discuss.elastic.co/t/docs-nofile-or-nproc/142049/3 "2018-07-29T00:35:47Z")

</div>

It's been a while that I sent you that message, but if I remember correctly I landed on that docs page because of an error I was having - and changing nofile wasn't helping. But when I followed your advice on that thread, instead of the docs, it worked!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 26, 2018, 12:35am UTC](https://discuss.elastic.co/t/docs-nofile-or-nproc/142049/4 "2018-08-26T00:35:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
