Loading

Too many open files error in logs and how to detect the leak

게시 일자: Mar 2, 2024
솔루션

SYMPTOM

The application logs are reporting error relating to "Too many open files".

CAUSE

This error can be caused by reaching the maximum allowable open file handles per your system configuration. This error can also be caused by file descriptor leaks (where there is a high enough ulimit open files setting, but the application still fails with this error).

A simple way to check how many open files for a given process is to run the following command: 
 
lsof -n -P -p <PROCESS-ID> | wc -l


SOLUTION

As steps will vary depending on operating system and requirements, consult your Operating system documentation on the best approach to increase open file limits. 

To get a list of your current operating system limits please refer to the article Operating System limits.

If you continue to observe file descriptors increasing by using the lsof command over time without any simple explanation (such as a higher load, or additional deployments), please collect the output from the command lsof -n -P -p <PROCESS-ID> and contact MuleSoft Support for additional assistance. However, it may be easier to run this command as a cron job that runs once an hour over 1 day of time to watch the leak. Here is the entry to add to your crontab as root user:

0 * * * * /bin/date >> /tmp/cron-lsof.txt; lsof -p <PROCESS-ID> >> /tmp/cron-lsof.txt


After running overnight, please upload the /tmp/cron-lsoft.txt file to the Mulesoft Support ticket so that we can look at where the growth of file descriptors happen.


 
Knowledge 기사 번호

001118128

 
로드 중
Salesforce Help | Article