Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable memory swapping by default #547

Open
janko opened this issue Feb 13, 2017 · 3 comments
Open

Disable memory swapping by default #547

janko opened this issue Feb 13, 2017 · 3 comments
Assignees

Comments

@janko
Copy link
Contributor

janko commented Feb 13, 2017

Thank you for maintaining this cookbook, it's been really helpful to us, and allowed us to remove a ton of manual configuration 馃槂

I just noticed that the cookbook doesn't seem to disable memory swapping, which according to the Elasticsearch documentation seems like it definitely should be the default. Specifically, I think the cookbook should add

bootstrap.memory_lock: true

for ES 5.x, and

bootstrap.mlockall: true

For ES 2.x and 1.x.

@martinb3 martinb3 self-assigned this Feb 13, 2017
@martinb3
Copy link
Contributor

martinb3 commented Feb 13, 2017

Hi there -- the elasticsearch_configure resource has an option memlock_limit which sets the MAX_LOCKED_MEMORY environment variable for init scripts (the systemd scripts shipped with elasticsearch apparently have this commented out, but it's in there too). That environment variable, according to the current documentation, will automatically set bootstrap.memory_lock: true. Have you tried using that?

@martinb3 martinb3 removed their assignment Feb 13, 2017
@janko
Copy link
Contributor Author

janko commented Feb 13, 2017

@martinb3 I understood from the documentation that setting MAX_LOCKED_MEMORY=unlimited will allow Elasticsearch to set make the mlockall request once you set bootstrap.memory_lock: true, not that it will automatically make Elasticsearch prevent memory swapping. But I haven't tried checking the nodes whether swapping was prevented by deafult, and we already added bootstrap.mlockall: true (we're on 2.4).

@martinb3
Copy link
Contributor

Just browsing through the issues filed on elastic/elasticsearch, it seems that a lot of folks have the same confusion that I did 馃槷

It seems that MAX_LOCKED_MEMORY is intended to affect the operating system, but bootstrap.memory_lock must still be paired with it. So it seems like the right thing to do would be to maybe change the default of bootstrap.memory_lock to be true. However, we're actually borrowing the defaults from elasticsearch's packaging.

We generally try to follow the defaults from Elasticsearch packaging -- I need to check and see what they do by default, and we'd likely follow that.

@martinb3 martinb3 self-assigned this Feb 13, 2017
@martinb3 martinb3 added this to the Support v6.0.0 milestone Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants