How to troubleshoot that the file handle consumes too much?
How to troubleshoot that the file handle consumes too much? This article uses the example code to show, the code is very detailed, which can be used for reference by interested friends. I hope it will be helpful to you.
Background:
As the business iterates, some projects are refactored with nodejs and deployed to run in the K8s environment. In order to facilitate the analysis, a version of the code is added to add the function of output log.
Phenomenon:
Half a day after the launch, I found that R & D feedback received an error warning that too many open files was used to open too many files, and some of the pod crash was dropped, affecting the user experience.
At the same time, when OPS checks the monitoring, you can see that the usage of file handles has increased sharply in a short period of time, as shown in the following figure: