RE: setting file handler limits


#1

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart etc.


#2

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart etc.


#3

nice! I think this is what I want :slight_smile:

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart etc.


#4

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart etc.


#5

You can always use the ulimit command in your runit or init scripts
directly. This will increase file limits for specific processes.

On 10/11/12 1:34 PM, “Mike” miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart
etc.


#6

I actually just wrote one the other day, but I have no idea how to share
it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart
etc.


#7

Actually - that was easier than I thought:
http://community.opscode.com/cookbooks/ulimit

It provides a user_ulimit resource that allows you to add ulimit overrides
for processes and filehandles for specific users. It also does the right
thing for Ubuntu, where ulimit overrides for the ‘su’ command is actually
disabled by default.

Brian

On Thu, Oct 11, 2012 at 4:39 PM, Brian Hatfield bhatfield@brightcove.comwrote:

I actually just wrote one the other day, but I have no idea how to share
it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart
etc.


#8

Very cool!

Cheers guys

–AJ

On 12 October 2012 09:49, Brian Hatfield bhatfield@brightcove.com wrote:

Actually - that was easier than I thought:
http://community.opscode.com/cookbooks/ulimit

It provides a user_ulimit resource that allows you to add ulimit overrides
for processes and filehandles for specific users. It also does the right
thing for Ubuntu, where ulimit overrides for the ‘su’ command is actually
disabled by default.

Brian

On Thu, Oct 11, 2012 at 4:39 PM, Brian Hatfield bhatfield@brightcove.com
wrote:

I actually just wrote one the other day, but I have no idea how to share
it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart
etc.


#9

Awesome!

Can you provide a link to the git repo of the source as well?

On Thu, Oct 11, 2012 at 4:49 PM, Brian Hatfield
bhatfield@brightcove.com wrote:

Actually - that was easier than I thought:
http://community.opscode.com/cookbooks/ulimit

It provides a user_ulimit resource that allows you to add ulimit overrides
for processes and filehandles for specific users. It also does the right
thing for Ubuntu, where ulimit overrides for the ‘su’ command is actually
disabled by default.

Brian

On Thu, Oct 11, 2012 at 4:39 PM, Brian Hatfield bhatfield@brightcove.com
wrote:

I actually just wrote one the other day, but I have no idea how to share
it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart
etc.


#10

Here you go: https://github.com/bmhatfield/chef-ulimit

On Thu, Oct 11, 2012 at 4:52 PM, Mike miketheman@gmail.com wrote:

Awesome!

Can you provide a link to the git repo of the source as well?

On Thu, Oct 11, 2012 at 4:49 PM, Brian Hatfield
bhatfield@brightcove.com wrote:

Actually - that was easier than I thought:
http://community.opscode.com/cookbooks/ulimit

It provides a user_ulimit resource that allows you to add ulimit
overrides
for processes and filehandles for specific users. It also does the right
thing for Ubuntu, where ulimit overrides for the ‘su’ command is actually
disabled by default.

Brian

On Thu, Oct 11, 2012 at 4:39 PM, Brian Hatfield <
bhatfield@brightcove.com>
wrote:

I actually just wrote one the other day, but I have no idea how to share
it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart
etc.


#11

a “limits” resource would be good, but generally since it’s easy to
manage as a template I’ve just implemented a limits cookbook (since
this tends to be stuff I set globally in base role).

On Thu, Oct 11, 2012 at 1:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server restart etc.


#12

Great thanks.

Is there a way to apply this to all users somehow and not specific accounts?

If I am running tomcat, redis, mysql I guess I would just be setting those
specific account names, and would have to apply this ulimit recipe at the
end since those accounts won’t be created until everything is installed.

Or if there is a way to modify the new account settings such that all
accounts will default to e.g. 999999.

On Thu, Oct 11, 2012 at 4:59 PM, Brian Hatfield bhatfield@brightcove.comwrote:

Here you go: https://github.com/bmhatfield/chef-ulimit

On Thu, Oct 11, 2012 at 4:52 PM, Mike miketheman@gmail.com wrote:

Awesome!

Can you provide a link to the git repo of the source as well?

On Thu, Oct 11, 2012 at 4:49 PM, Brian Hatfield
bhatfield@brightcove.com wrote:

Actually - that was easier than I thought:
http://community.opscode.com/cookbooks/ulimit

It provides a user_ulimit resource that allows you to add ulimit
overrides
for processes and filehandles for specific users. It also does the right
thing for Ubuntu, where ulimit overrides for the ‘su’ command is
actually
disabled by default.

Brian

On Thu, Oct 11, 2012 at 4:39 PM, Brian Hatfield <
bhatfield@brightcove.com>
wrote:

I actually just wrote one the other day, but I have no idea how to
share

it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server
restart

etc.


#13

Put all of those users into a group and manage the limits for the group?

–AJ

On 13 November 2012 04:23, S Ahmed sahmed1020@gmail.com wrote:

Great thanks.

Is there a way to apply this to all users somehow and not specific
accounts?

If I am running tomcat, redis, mysql I guess I would just be setting those
specific account names, and would have to apply this ulimit recipe at the
end since those accounts won’t be created until everything is installed.

Or if there is a way to modify the new account settings such that all
accounts will default to e.g. 999999.

On Thu, Oct 11, 2012 at 4:59 PM, Brian Hatfield bhatfield@brightcove.comwrote:

Here you go: https://github.com/bmhatfield/chef-ulimit

On Thu, Oct 11, 2012 at 4:52 PM, Mike miketheman@gmail.com wrote:

Awesome!

Can you provide a link to the git repo of the source as well?

On Thu, Oct 11, 2012 at 4:49 PM, Brian Hatfield
bhatfield@brightcove.com wrote:

Actually - that was easier than I thought:
http://community.opscode.com/cookbooks/ulimit

It provides a user_ulimit resource that allows you to add ulimit
overrides
for processes and filehandles for specific users. It also does the
right
thing for Ubuntu, where ulimit overrides for the ‘su’ command is
actually
disabled by default.

Brian

On Thu, Oct 11, 2012 at 4:39 PM, Brian Hatfield <
bhatfield@brightcove.com>
wrote:

I actually just wrote one the other day, but I have no idea how to
share

it. It’s quite simple, and provides user_ulimit as a resource.

I’ll ask my coworker and get it uploaded.

On Thu, Oct 11, 2012 at 4:34 PM, Mike miketheman@gmail.com wrote:

AJ - that’s cool for sysctl, but I don’t think it addresses
user-session file handler limits.

I haven’t seen a cookbook out there yet that does templated/lwrp
/etc/security/limits.d/*.conf files yet - might be worth writing one.

-Mike

On Thu, Oct 11, 2012 at 4:23 PM, AJ Christensen aj@junglist.gen.nz
wrote:

I use Jesse Nelson’s (spheromak) sysctl cookbook for helping with
stuff like this.

https://github.com/spheromak/sysctl-cookbook

Cheers,

AJ

On 12 October 2012 09:06, S Ahmed sahmed1020@gmail.com wrote:

Are there any chef recipes to adjust a servers file handler limit?

Trying to do stuff like
http://www.lognormal.com/blog/2012/09/27/linux-tcpip-tuning/

Not sure how to go about doing this, if it requires a server
restart

etc.