Re: cloudfoundry file descriptor limit is too small


Hi peter,

DEA's file descriptor limit and application's one are two different things.

An application's file descriptor limit is defined as a property of the
process of the application instance running in a warden container.

You can see it by the following procedure:

1. Log in to the DEA (`bosh ssh runner_z1/0` or something)
2. Become superuser (`sudo -i`)
3. Find running warden container ID (execute `ls -l
/var/vcap/data/warden/depot` and you may see the list of running warden
container IDs)
4. Log in to the target warden container
(`/var/vcap/data/warden/depot/*WARDEN-CONTAINER-ID*/bin/wsh --socket
/var/vcap/data/warden/depot/*WARDEN-CONTAINER-ID*/run/wshd.sock --user vcap
/bin/bash`, you should replace "*WARDEN-CONTAINER-ID*" to the ID you've
5. Get the process ID of the application process (`cat /home/vcap/`)
6. Get the limit property of the process (`cat /proc/*PID*/limits`, of
course you should replace *PID* to the actual process ID)
7. Now you may see the value of the file descriptor limit on the line "Max
open files"

In my case, it was 16384.

This value is defined by the Cloud Controller property
"instance_file_descriptor_limit" [1], and the default is 16384 [2].

It seems large enough for me, but if you want to change the number, it can
be done by changing " cc.instance_file_descriptor_limit" in your BOSH
deployment manifest and redeploy Cloud Controller.

I think it cannot be changed per application [3].



peter huang wrote
Hi, All,
My cloudfoundry version is 225, when i run some java spring-boot program
in the cf, sometime it will throw the "too many files open" exception, i
know it is about the file limit.
So i login to the runner, and use `ulimit -n` to see, they are 1024, but i
found in the warden .\cf-release-225\jobs\dea_next\templates\dea_ctl.erb
it call `ulimit -n 4096`, looks like it doesn't work.
and in
Line 1418: response = => handle, :script => "ulimit
-n", :rlimits => rlimits)
no sure it will overwrite the exist one(i don't know ruby)
my question is, does they some way to expand the size of limit ? or we
need to upgrade the cloudfoundry?

I'm not a ...
View this message in context:
Sent from the CF Dev mailing list archive at

Join { to automatically receive all group messages.