0

I am doing a perf test of one of my API. After some time I keep getting the error Too many open file. Once I increase the number of open file descriptor (ulimit -Hn, ulimit -Sn & cat /proc/sys/fs/file-max) then the request / sec my API can server increases. But then again the too many open file descriptor error comes.

Can someone let me know if it is possible to set the open file descriptor limit to unlimited so that I don't want to increase the value every time and just know what is the breaking limit of the API assuming I have sufficient file descriptor.

I am using Debian 8.

tuk
  • 333
  • 5
  • 18
  • Yes you can, edit /etc/security/limits.conf and add your user from which you are running the command, and add this line "user soft nofile 1000000". It's recommended to write a large size rather than unlimited, but i think it's enough for your tests. Have a look [here](https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/) – Alin Andrei Dec 08 '16 at 10:25
  • Is it also possible to set `unlimited` instead of some large number? – tuk Dec 11 '16 at 05:38

1 Answers1

0

To set unlimited: ulimit -u unlimited

quux
  • 116
  • 1