Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This article helps you to find out information about file descriptors used by the system.

Prerequisite:

An exception as “Too many files open” is observed in your hivemq.log
and max open file limit is already set as “1000000“ files.

Instructions

Step 1:

There are two ways to get a current an open and max file descriptor(FD) count.

  1. Enable monitoring with HiveMQ Promothus extension. The highly-performant metrics subsystem of HiveMQ lets you monitor relevant metrics with no reduction in system performance (even in low-latency high-throughput environments).

    In the context of this article you can check following matrics:
    com.hivemq.system.open-file-descriptor
    com.hivemq.system.max-file-descriptor

    These metrics provide counts of currently open file descriptors and max file descriptors.

  2. Also, as an alternative, you can use the below commands from your shell to get the requested metrics

    1. The following command displays the soft limit, hard limit, and units of measurement for each of the process's resource limits. From that list, you can get details about Max open files
      $ cat /proc/1/limits

    2. The following command can be used to know how many file descriptors are being used
      $ cat /proc/sys/fs/file-nr
      You can interpret the file content as
      column 1 = total allocated file descriptors (the number of file descriptors allocated since boot)
      column 2 = total free allocated file descriptors
      column 3 = maximum open file descriptors

    3. $ ulimit to know the number of open file descriptors per process

Step 2

Please execute the following steps to get the list of open files.

  1. Install lsof if it’s not available already else skip this step

    • $ apt update && apt install lsof

  2. switch to hivemq user (UID of the process)

    • $ su hivemq

  3. show all open files

    • $ lsof -p 1 > open_files.txt

Share created open_files.txt with HiveMQ support to investigate further.

 

  • No labels