Hi Andrzej,
Is there any way to make mongodb server to limit opened file descriptors? I’m using wiredtiger engine and server opens at least 2 descriptors per collection. It looks like it’s opened on server start or collection creation and never closed. Documentation has no configuration parameter for file descriptors.
That is correct. WiredTiger will open one file per collection and per index. Since each collection will have its _id
filed indexed automatically, WiredTiger will open at least 2 files per collection. Please see the Resource Utilization page for more details.
Currently, there is no setting that can limit the file descriptors used by MongoDB. Depending on the applicability on your use case, you could either limit the number of collection (which could negatively impact your application’s use case), or limit the number of indexes per collection (which could negatively impact performance). What is the reason for limiting MongoDB file descriptor usge? Is there any issue that you observed due to the number of files opened by MongoDB?
Best regards,
Kevin