Add a diagnostic that will tell if the device is accessing too many files which causes other services to behaviour eradicate as they fail to open the files they need.
We can check file descriptors available with:
[root@box proc]# cat /proc/sys/fs/file-nr
3853 908 53182
| | |
| | |
| | max: maximum open file descriptors
| free: total free allocated file descriptors
allocated: total allocated file descriptors since boot
To calculate the number that are currently in use, just do allocated - free. You could also calculate a percentage of used descriptors by doing ((allocated - free) / max) * 100
Both of these could be combined into a single boolean: limited_file_access which is described as "This warning indicates if process on the device may be experiencing issues accessing files due to low inode or file descriptors available.
Add a diagnostic that will tell if the device is accessing too many files which causes other services to behaviour eradicate as they fail to open the files they need.
We can check file descriptors available with:
To calculate the number that are currently in use, just do allocated - free. You could also calculate a percentage of used descriptors by doing ((allocated - free) / max) * 100
from https://stackoverflow.com/questions/7976769/getting-count-of-current-used-file-descriptors-from-c-code
and for inodes:
Both of these could be combined into a single boolean:
limited_file_access
which is described as "This warning indicates if process on the device may be experiencing issues accessing files due to low inode or file descriptors available.