limit nofile has no effect?

James Hunt james.hunt at ubuntu.com
Fri May 27 13:26:22 UTC 2011


Hi Pablo,

On 20/05/11 17:48, pablo platt wrote:
> I'm using upstart to start an erlang web server.
> I'm using limit nofile to increase the number of allowed file
> descriptors but when checking the limits I'm still seeing the default.
> I'm getting errors for too many open file descriptors.
> 
> Am I doing something wrong?
No, it's just that "limit nofile" currently simply calls setrlimit(2) on
behalf of the application.

Regards,

James.

> 
> When increasing the nofile in the /etc/security/limits.conf file, the
> errors goes away:
> * soft nofile 30000
> * hard nofile 30000
> 
> I'm checking the beam (the process that is running the erlang vm) with:
> pidof beam
> cat /proc/<pid>/limits
> ...
> Max open files            1024                 4096                 files
> ...
> 
> the upstart script:
> --------------------------
> limit nofile 20000 20000
> 
> start on (local-filesystems and net-device-up IFACE!=lo)
> stop on runlevel [016]
> 
> export HOME=/var/lib/myapp
> 
> 
> script
>     exec sudo -u myapp -i myapp start
> end script
> 
> pre-stop script
>     exec sudo -u myapp -i myapp stop
> end script
> 
> 



More information about the upstart-devel mailing list