Logging decrease my app performance
George Hope
george@REDACTED
Mon Nov 16 09:03:11 CET 2020
My client-server app test when I run server with notice log level finishes in about 0m0.973s
when I change the server log level to debug it finishes in 0m3.514s,
If I wrap all logger:debug in spawn(fun() -> logger:debug("Sending Response to Client Pid~w~n", [Pid]) end)
It finishes in 0m1.150s.
what should I do to avoid this performance loss when loglevel is debug?
and Is there a better way than spawn new process for every log?
My handler config:
[{kernel,[{logger,[
{handler, default, logger_std_h,#{level => error,config => #{file => "log/error.log"}}},
{handler, info, logger_disk_log_h,#{level => debug,config => #{file => "log/debug.log",sync_mode_qlen => 20000,
drop_mode_qlen=>22000,flush_qlen=>23000}}}]}]}].
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20201116/0b3a1926/attachment.htm>
More information about the erlang-questions
mailing list