lager icon indicating copy to clipboard operation
lager copied to clipboard

Will too much lager log lead to CPU arise?

Open Ami-Kawashima opened this issue 4 years ago • 2 comments

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.

Ami-Kawashima avatar Dec 23 '20 03:12 Ami-Kawashima

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

jadeallenx avatar Dec 23 '20 15:12 jadeallenx

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.

Ami-Kawashima avatar Dec 24 '20 01:12 Ami-Kawashima