How to set a global nofile limit to avoid “many open files” error?

Fixed this issue by setting the limits for all users in the file : $ cat /etc/security/limits.d/custom.conf * hard nofile 550000 * soft nofile 550000 REBOOT THE SERVER after setting the limits. VERY IMPORTANT: The /etc/security/limits.d/ folder contains user specific limits. In my case hadoop 2 (cloudera) related limits. These user specific limits would override … Read more

Ubuntu, upstart, and creating a pid for monitoring

If start-stop-daemon is available on your machine, I would highly recommend using it to launch your process. start-stop-daemon will handle launching the process as an unprivileged user without forking from sudo or su (recommended in the upstart cookbook) AND it also has built in support for pid file management. Eg: /etc/init/app_name.conf #!upstart description “Redis Server” … Read more

A better way to restart/reload Gunicorn (via Upstart) after ‘git pull’ing my Django projects

You can tell Gunicorn to reload gracefully using the HUP signal like so: kill -HUP <pid> (see the FAQ for details) I use Supervisor to control my Gunicorn server, which allows me to use this (slightly hacky) way of reloading Gunicorn after a deploy: supervisorctl status gunicorn | sed “s/.*[pid ]\([0-9]\+\)\,.*/\1/” | xargs kill -HUP … Read more

tech