cloudfoundry file descriptor limit is too small


Noburou TANIGUCHI
 

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
choosed)
5. Get the process ID of the application process (`cat /home/vcap/run.pid`)
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].

[1]
https://github.com/cloudfoundry/cloud_controller_ng/blob/8b93c0ccdcda44d46a2e574240bc0f69512ac3d5/bosh/jobs/cloud_controller_ng/templates/cloud_controller_api.yml.erb#L111
[2]
https://github.com/cloudfoundry/cloud_controller_ng/blob/654e39c6d22f99e75ba0833236c5e6a3f12ad967/bosh/jobs/cloud_controller_ng/spec#L686-L688
[3] https://github.com/cloudfoundry/capi-release/issues/11

Regards,


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
.\cf-release-225\packages\dea_next\dea_next\vendor\cache\warden-181b550918c8\warden\spec\container\linux_spec.rb
Line 1418: response = client.run(:handle => 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?
Thanks,
Peter




-----
I'm not a ...
Noburou TANIGUCHI
--
View this message in context: http://cf-dev.70369.x6.nabble.com/cf-dev-cloudfoundry-file-descriptor-limit-is-too-small-tp5948p6084.html
Sent from the CF Dev mailing list archive at Nabble.com.


Lynn Lin
 

folks ,
any insight ?


peter huang
 

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 .\cf-release-225\packages\dea_next\dea_next\vendor\cache\warden-181b550918c8\warden\spec\container\linux_spec.rb
Line 1418: response = client.run(:handle => 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?
Thanks,
Peter