Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lager version 3.5.2, issue of excessive memory usage #578

Open
taoozhou opened this issue Jan 2, 2024 · 6 comments
Open

Lager version 3.5.2, issue of excessive memory usage #578

taoozhou opened this issue Jan 2, 2024 · 6 comments

Comments

@taoozhou
Copy link

taoozhou commented Jan 2, 2024

04ca062ecfb75c83c05530d64956865

@taoozhou taoozhou changed the title Lager version 3.5.2, for unknown reasons, causes excessive memory usage Lager version 3.5.2, causes excessive memory usage Jan 2, 2024
@taoozhou
Copy link
Author

taoozhou commented Jan 2, 2024

My erlang program is deployed in a Docker environment, and the lager writes console logs to the console.log file. However, for unknown reasons, it stores the logs in memory messages instead of writing them to the file.

@taoozhou taoozhou changed the title Lager version 3.5.2, causes excessive memory usage Lager version 3.5.2, issue of excessive memory usage Jan 2, 2024
@taoozhou
Copy link
Author

taoozhou commented Jan 5, 2024

When this issue occurs, the lager no longer writes logs to the console and console.log file, blocking messages in memory and unable to release them, resulting in an increasing memory usage.

The original console log level was debug, but this issue occurred. I adjusted the console log level to warning and wrote the debug level log to a file instead of the console and file. It seems that this issue has been significantly improved, and there has been no problem of excessive memory usage again.

@Vagabond
Copy link
Member

and you're not logging to stdout or another non-file backend at all? how many logs do you think you were generaying per second?

@taoozhou
Copy link
Author

and you're not logging to stdout or another non-file backend at all? how many logs do you think you were generaying per second?

I output the logs to both the program console and console.log file at the same time, and the speed of the problem depends on the frequency of the log output. When there are more than ten logs per second, this problem occurs in three or four days of college. When there are forty to fifty logs per second or even higher, this problem occurs in less than half an hour.

Perhaps I can send out the tiger configuration file to take a look, but it will need to wait until next Monday.

If I increase the console log level and lower the log level output to the console.log file, can I also solve this problem? Because the system has already been launched into the production environment, when this issue occurred, I set the console and output log levels to a high level, which prevented me from seeing some debug logs and preventing me from stopping my application.

@taoozhou
Copy link
Author

After this issue occurred, I changed my lager configuration file and raised the console log level, making it almost impossible for logs to be output to the console. Secondly, I will output the debug logs to a log file. The log output rate may be around 40-50 per second, and there is no memory freeze caused by the inability to output logs to the console and files, which seems to solve this problem.

@taoozhou
Copy link
Author

My English proficiency is not very good, and I often use translation software to translate into English, which may cause confusion. I hope you can forgive me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants