1

I currently have the following entry in /etc/security/limits.d/90-nproc.conf based on Mongo DB's recommended ulimit settings.

mongod     soft    nofile    64000
mongod     soft    nproc     64000

I need to massively increase the number of permitted file descriptors to - say - 999999. In normal situations only a few thousand files are likely to be accessed per day. The reason for the large number of files is the way the WiredTiger storage engine works. It uses several files per collection, of which I have many thousands.

Are there any negative impacts to this situation?

Is it detrimental to system performance to have a huge number of file descriptors open, but largely unused?

1

nproc is the number of processes limit. If you mean files you want nofiles.

It is merely a maximum limit counter. Increasing the limit doesn't use resources until that many things are in use on the system.

64k is a lot of processes. Your performance may suffer depending on how much memory and CPU you have. The Linux scheduler overhead may become significant with this many tasks.

Also adjust file descriptors if necessary, as mentioned in mongodb reference on ulimit. File descriptors are relatively lightweight, and you need one for every open file and socket, but 64k is still a lot.

  • Thank you. So ulimit -u rather than ulimit -n to allow more file descriptors... is that correct? – Tim Apr 29 '19 at 18:42
  • I've updated my question slightly. 64k is what the vendor recommends, but I'm looking at needing at least 10 times that, and it will grow. – Tim Apr 29 '19 at 18:47
0

One issue I can see is, if we give too much nproc to the user and user actually able to reach due to bug in code so there will not be anything for root to execute. Another issue will be each process need resources to maintain it's states and to do processing if we give that much resources developer can exploit the system and surely problematic for system to handle also you have to consider other resources like RAM etc for such big limits.

  • Thanks for the answer. I have to trust that the DB software is secure in that regard. I posted on their user forum, but not received a reply yet. I suppose it could happen due to bug in my code too, but opening all files by accident is highly unlikely – Tim Apr 30 '19 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.