Logging decrease my app performance

George Hope george@REDACTED
Mon Nov 16 09:34:02 CET 2020


I made a mistake spawn version finishes  in 0m2.987s, still faster than normal version.



---- On Mon, 16 Nov 2020 11:33:11 +0330 George Hope <george@REDACTED> wrote ----


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/5833a897/attachment.htm>


More information about the erlang-questions mailing list