Rate This Document
Findability
Accuracy
Completeness
Readability

Failed to Collect Data Because the Number of File Descriptors Exceeded the Maximum

Symptom

A data collection task failed because the number of file descriptors exceeded the maximum. Increase the maximum number of file descriptors as required.

Possible Cause

The process of the data collection task requires more file descriptors than it is allowed to have.

Troubleshooting Procedure

Exercise caution when changing the maximum number of file descriptors because it may bring the following risks:

  1. Excessive system resource consumption: If the maximum number of file descriptors is set to a large value, more system resources will be consumed, which may slow down or crash the system.
  2. Security issue: If the maximum number of file descriptors is set to a large value, the system is prone to attacks because attackers can use more file descriptors to consume system resources or perform malicious operations.
  3. Application compatibility issue: If the maximum number of file descriptors is set to a large value, some applications may crash or cannot work properly.
  • Changing the maximum number of file descriptors on a local node
  1. Locate the service file of gunicorn_framework.service.
    1
    systemctl status gunicorn_framework.service
    
    Figure 1 Service details
  2. Add a configuration item.
    1
    vi /usr/lib/systemd/system/gunicorn_framework.service
    

    Add the LimitNOFILE parameter to the [Service] section.

    Figure 2 New configuration item

    Press Esc, type :wq!, and press Enter to save the file and exit.

  3. Restart gunicorn_framework.service.
    1
    2
    systemctl daemon-reload
    systemctl restart gunicorn_framework.service
    
  • Changing the maximum number of file descriptors on a remote node
    Open the /etc/security/limits.conf file.
    1
    vi /etc/security/limits.conf
    

    Add the following content to the file:

    1
    2
    devkit soft nofile configured_value
    devkit hard nofile configured_value
    
    Figure 3 Added content

    Press Esc, type :wq!, and press Enter to save the file and exit.