Monday, June 2, 2014

resonable resource limits for production EC2 instances

Typically, you may want to tune your production ec2 instance's resource limits because the defaults are fairly low for any practical purposes:


  • In your /etc/security/limits.conf, you can set the hard limit and soft limit for no. of file descriptors and max user processes. NOTE - If you set max process value in etc/security/limits.d/90-nproc.conf, it will override the value in limits.conf. Also, you must reboot your instances in both cases.
*******
*                     hard    nofile          65535
*                     soft     nofile          65535
@<user>        hard   nproc          16384
@<user>        soft    nproc          4096
*******

  • If you have multiple user processes running, then you may want to set "kernel.max_pid" parameter in /etc/sysctl.conf
********
#Allow for more PIDs
kernel.pid_max = 65536
********


No comments:

Post a Comment