basho-labs / puppet-riak

A puppet module to deploy Riak clusters
Apache License 2.0
33 stars 37 forks source link

/etc/default/riak ulimit support #13

Open Iristyle opened 11 years ago

Iristyle commented 11 years ago

I realize this is OS specific, but wondering if you've given any thought to including this?

See https://github.com/basho/riak-chef-cookbook/commit/41661c227e1a985a52ee87678a91588d05fbe372 for the chef cookbook

haf commented 11 years ago

Does this mean that riak would be allowed to open more file descriptors?

Iristyle commented 11 years ago

Yes, default is 1024 (at least on Ubuntu which is what we're using) and recommend is a minimum of 4096

http://docs.basho.com/riak/latest/cookbooks/Open-Files-Limit/

I think the most correct way is to probably use PAM... but I haven't tried it out yet.

There are PAM modules floating around at

Iristyle commented 11 years ago

In response to #17 ... from the Riak docs. I think the most correct answer is to set /etc/default/riak and the PAM method.

The initial docs say:

On Ubuntu, if you’re always relying on the init scripts to start Riak, you can create the file /etc/default/riak and specify a manual limit like so: ulimit -n 65536

...

As init scripts are always run as the root user, there’s no need to specifically set limits in /etc/security/limits.conf if you’re solely relying on init scripts.

But from what I can tell, the PAM method is correct if you need to perform, e.g. join commands over SSH?

Unfortunately I'm not an expert over various distro versions. We're fixed on Precise as its LTS.

hectcastro commented 11 years ago

For the Chef cookbook we took the /etc/default/riak route for Debian due to the start-stop-daemon init script update: https://github.com/basho/riak-chef-cookbook/commit/26f21f990f516d9cb1c111f05e6c80f6a3115598

Apparently, start-stop-daemon bypasses PAM, which skips overrides in /etc/security/limits.conf.

haf commented 10 years ago

Potential candidate for being used: https://github.com/hercules-team/augeasproviders/issues/35

dalesit commented 8 years ago

I believe this is now in the module from Pull #64, so could presumably be closed.