Re: Logging decrease my app performance

George Hope <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
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 <[email protected]> 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}}}]}]}].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.