# Why is mlockall setting failing on Elasticsearch?

**URL:** <https://discuss.elastic.co/t/why-is-mlockall-setting-failing-on-elasticsearch/87>\
**Category:** Elasticsearch\
**Created:** [May 1, 2015, 10:11am UTC](https://discuss.elastic.co/t/why-is-mlockall-setting-failing-on-elasticsearch/87 "2015-05-01T10:11:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [May 1, 2015, 10:11am UTC](https://discuss.elastic.co/t/why-is-mlockall-setting-failing-on-elasticsearch/87/1 "2015-05-01T10:11:08Z")

</div>

#### QUESTION

According to the `elasticsearch.yml`:

```auto
bootstrap.mlockall: true

```

But according to ES when queried they are all false.

```auto
curl 'http://127.0.0.1:9200/_nodes/process?pretty; | grep mlockall 
 "mlockall" : false 
 "mlockall" : false 
 "mlockall" : false 
 "mlockall" : false 
 "mlockall" : false 

```

Which is correct? Maybe a bug?

#### ANSWER

If you see that `mlockall` is false, then it means that the the `mlockall` request has failed. The most probable reason is that the user running Elasticsearch doesn’t have permission to lock memory. This can be granted by running

```auto
ulimit -l unlimited

```

as `root` before starting Elasticsearch.

Another possible reason why `mlockall` can fail is that the temporary directory (usually `/tmp`) is mounted with the `noexec` option. This can be solved by specfying a new temp directory, by starting Elasticsearch with:

```auto
./bin/elasticsearch -Djna.tmpdir=/path/to/new/dir

```

---

<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:** [July 6, 2017, 12:16am UTC](https://discuss.elastic.co/t/why-is-mlockall-setting-failing-on-elasticsearch/87/2 "2017-07-06T00:16:18Z")

</div>


