Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to troubleshoot that the file handle consumes too much?

Shulou Source: shulou.com Published: 2022-06-03 06:08:25 10月04日 Update

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:

Tags: File handle problem log node code excess maximum content kernel method part service monitoring limit consumption quantity server environment user Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia Microsoft MySQL macOS