erlang-lager / lager

A logging framework for Erlang/OTP
Apache License 2.0
1.12k stars 455 forks source link

Will too much lager log lead to CPU arise? #533

Open Ami-Kawashima opened 3 years ago

Ami-Kawashima commented 3 years ago

Recently,I have a erlang gateway project in rancher. One pod' CPU arise, alive, can't be accessed in. Last year, I have used tsung to test it, one lager log cause -66%, two -82%. Is there any idea or infomation? thank you.

jadeallenx commented 3 years ago

Writing to the console is generally more CPU intensive than writing to disk files so make sure you’re not logging to the console.

That being said, depending on the quantity of log messages there can be an overhead that is measurable - you may want to consider logging messages at a higher severity level or removing log messages that are no longer necessary for general operation of the application

Ami-Kawashima commented 3 years ago

Writing to the console is generally more CPU intensive than writing to disk files so make sure you’re not logging to the console.

That being said, depending on the quantity of log messages there can be an overhead that is measurable - you may want to consider logging messages at a higher severity level or removing log messages that are no longer necessary for general operation of the application

Thankyou. I'm logging to the /logs/console.log. I will send log to elk later and try to resolve that issue.