<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>I made a mistake spawn version finishes in 0m2.987s, still faster than normal version.<br></div><br><div style="" data-zbluepencil-ignore="true" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Mon, 16 Nov 2020 11:33:11 +0330 <b>George Hope <george@1w1g.com></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10.0pt;"><div class="x_116648915zmail_extra"><blockquote style="border-left: 1.0px solid rgb(204,204,204);padding-left: 6.0px;margin: 0.0px 0.0px 0.0px 5.0px;"><div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10.0pt;"><div style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10.0pt;"><div><div>My client-server app test when I run server with <b>notice</b> log level finishes in about 0m0.973s<br></div><div>when I change the server log level to <b>debug </b>it finishes in 0m3.514s,<br></div><div>If I wrap all <span class="colour" style="color:rgb(78, 201, 176)">logger</span><span class="colour" style="color:rgb(212, 212, 212)">:</span><span class="colour" style="color:rgb(255, 0, 0)">debug </span><span class="colour" style="color:rgb(0, 0, 0)">in</span><span class="colour" style="color:rgb(255, 0, 0)"> </span><span class="colour" style="color:rgb(220, 220, 170)"><span class="colour" style="color:rgb(0, 0, 0)">spawn</span></span><span class="colour" style="color:rgb(212, 212, 212)"><span class="colour" style="color:rgb(0, 0, 0)">(</span></span><span class="colour" style="color:rgb(197, 134, 192)"><span class="colour" style="color:rgb(0, 0, 0)">fun</span></span><span class="colour" style="color:rgb(212, 212, 212)"><span class="colour" style="color:rgb(0, 0, 0)">() -> <span class="colour" style="color:rgb(78, 201, 176)">logger</span><span class="colour" style="color:rgb(212, 212, 212)">:</span><span class="colour" style="color:rgb(255, 0, 0)">debug</span>(</span></span><span class="colour" style="color:rgb(206, 145, 120)"><span class="colour" style="color:rgb(0, 0, 0)">"Sending Response to Client Pid~w~n"</span></span><span class="colour" style="color:rgb(212, 212, 212)"><span class="colour" style="color:rgb(0, 0, 0)">, [</span></span><span class="colour" style="color:rgb(156, 220, 254)"><span class="colour" style="color:rgb(0, 0, 0)">Pid</span></span><span class="colour" style="color:rgb(212, 212, 212)"><span class="colour" style="color:rgb(0, 0, 0)">]) </span></span><span class="colour" style="color:rgb(197, 134, 192)"><span class="colour" style="color:rgb(0, 0, 0)">end</span></span><span class="colour" style="color:rgb(212, 212, 212)"><span class="colour" style="color:rgb(0, 0, 0)">)</span></span><br></div><div><span class="colour" style="color:rgb(212, 212, 212)"><span class="colour" style="color:rgb(0, 0, 0)">It finishes in 0m1.150s.</span></span><br></div><div>what should I do to avoid this performance loss when loglevel is debug?<br></div><div>and Is there a better way than spawn new process for every log?<br></div><div><br></div><div>My handler config:<br></div><div style="color: rgb(212,212,212);background-color: rgb(30,30,30);font-family: "Droid Sans Mono", monospace, monospace, "Droid Sans Fallback";font-weight: normal;font-size: 14.0px;line-height: 19.0px;white-space: pre-wrap;"><div><span class="colour" style="color:rgb(212, 212, 212)">[{kernel,[{logger,[</span><br></div><div><span class="colour" style="color:rgb(212, 212, 212)">{handler, default, logger_std_h,#{level => error,config => #{file => </span><span class="colour" style="color:rgb(206, 145, 120)">"log/error.log"</span><span class="colour" style="color:rgb(212, 212, 212)">}}},</span><br></div><div><span class="colour" style="color:rgb(212, 212, 212)">{handler, info, logger_disk_log_h,#{level => debug,config => #{file => </span><span class="colour" style="color:rgb(206, 145, 120)">"log/debug.log"</span><span class="colour" style="color:rgb(212, 212, 212)">,sync_mode_qlen => </span><span class="colour" style="color:rgb(181, 206, 168)">20000</span><span class="colour" style="color:rgb(212, 212, 212)">,</span><br></div><div><span class="colour" style="color:rgb(212, 212, 212)">drop_mode_qlen=></span><span class="colour" style="color:rgb(181, 206, 168)">22000</span><span class="colour" style="color:rgb(212, 212, 212)">,flush_qlen=></span><span class="colour" style="color:rgb(181, 206, 168)">23000</span><span class="colour" style="color:rgb(212, 212, 212)">}}}]}]}].</span><br></div></div></div></div></div></div></blockquote></div><div><br></div><div><br></div></div><br></div></blockquote></div><div><br></div></div><br></body></html>