Unknown mlockall error 0

In my elasticsearch.yml I set:

bootstrap.mlockall: true

But on startup (elasticsearch 0.19.4) I see this message:

[WARN][common.jna] Unknown mlockall error 0

My /etc/security/limits.conf (Ubuntu 10.04 LTS) has this:

elasticsearch - nofile 64000
elasticsearch - memlock unlimited

Also I can see that:

$ sudo -u elasticsearch /bin/sh -c ulimit -l
unlimited

Any ideas what else could preventing mlockall from working?

My /etc/security/limits.conf (Ubuntu 10.04 LTS) has this:

elasticsearch - nofile 64000
elasticsearch - memlock unlimited

Try adding this line to /etc/pam.id/common-session:

session required pam_limits.so
1 Like

On May 23, 1:58 am, Clinton Gormley cl...@traveljury.com wrote:

My /etc/security/limits.conf (Ubuntu 10.04 LTS) has this:

elasticsearch - nofile 64000
elasticsearch - memlock unlimited

Try adding this line to /etc/pam.id/common-session:

session required pam_limits.so

Thanks; I added that line to /etc/pam.d/common-session, but still get
the same warning when starting elasticsearch with "bootstrap.mlockall:
true".

I'm using OpenJDK (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3), could that
be an issue?

Eric did you ever get a solution to this? I'm having the same problem on
ubuntu 13.04 with java 1.7.0_25. :S

On Wednesday, May 23, 2012 1:36:42 PM UTC-5, Eric Jain wrote:

On May 23, 1:58 am, Clinton Gormley cl...@traveljury.com wrote:

My /etc/security/limits.conf (Ubuntu 10.04 LTS) has this:

elasticsearch - nofile 64000
elasticsearch - memlock unlimited

Try adding this line to /etc/pam.id/common-session:

session required pam_limits.so 

Thanks; I added that line to /etc/pam.d/common-session, but still get
the same warning when starting elasticsearch with "bootstrap.mlockall:
true".

I'm using OpenJDK (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3), could that
be an issue?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Fri, Nov 15, 2013 at 4:49 AM, James Carr james.r.carr@gmail.com wrote:

Eric did you ever get a solution to this? I'm having the same problem on
ubuntu 13.04 with java 1.7.0_25. :S

No, still haven't got this to work.

OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.04.2)

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

That is not a JVM related problem.

If there is enough free RAM on a 64-bit Linux/JVM environment, a setting of

soft memlock unlimited
hard memlock unlimited

in /etc/security/limits.conf should work ( must logout and login of
course).

Jörg

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Fri, Nov 15, 2013 at 1:02 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

That is not a JVM related problem.

If there is enough free RAM on a 64-bit Linux/JVM environment, a setting of

soft memlock unlimited
hard memlock unlimited

in /etc/security/limits.conf should work ( must logout and login of
course).

That does not appear to be sufficient, at least not on Ubuntu (when
running elasticsearch as a non-interactive user).

Found a possible solution at
http://www.dctrwatson.com/2012/03/limits-conf-and-daemons-on-ubuntu/,
but am still getting the "unknown mlockall error 0" after updating the
/etc/pam.d/common-session* files...

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Is the OS running in a virtual machine?

Jörg

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Sat, Nov 16, 2013 at 10:23 AM, joergprante@gmail.com
joergprante@gmail.com wrote:

Is the OS running in a virtual machine?

Yes (ec2); but that shouldn't matter?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I'm not familiar with EC2 to be honest, but afaik EC2 is equivalent to Xen
virtualization.

EC2 comes in two flavors: PVM or HVM (paravirtualized and
hardware-virtualized VM).

Only in HVM the hugepage feature can be enabled (which is what
memlock=unlimited effectively activates). The hugepage Linux kernel feature
is important for the mlockall() call since only these pages of 2M size can
be pinned down to RAM.

In PVM I am quite sure that hugepages kernel feature and mlockall() will
not work at all, the host OS will steal pages whenever it likes.

Jörg

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

1 Like

On Sat, Nov 16, 2013 at 11:25 AM, joergprante@gmail.com
joergprante@gmail.com wrote:

In PVM I am quite sure that hugepages kernel feature and mlockall() will not
work at all, the host OS will steal pages whenever it likes.

My instances are indeed paravirtualized, no need chasing this goose then.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.