Definitely use syslog. To see how much logging is costing you without changing code, you can simply route to /dev/null via syslog. Btw, w/ local logging, you may not see it in the cpu usage - more likely in the i/o wait. In my experience, logging to a remote syslog-ng server over udp has very little impact on the app, almost like logging to /dev/null (which in turn is like not logging at all). <div>
<br></div><div>Are you by chance on AWS/EC2 ? If so, please contact me to discuss possible design partnership. <br><div><br></div><div>m</div><div><br><div><br></div><div><br><br><div class="gmail_quote">On Fri, Apr 9, 2010 at 11:57 AM, Jason J. W. Williams <span dir="ltr"><<a href="mailto:jasonjwwilliams@gmail.com">jasonjwwilliams@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Paul,<br>
<br>
Is is sporadic? (the CPU burst) If so, you may be seeing the log<br>
rotation code kicking...and it's probably blocking your app too until<br>
it completes.<br>
<br>
I've got a couple patches to fix the blocking issue:<br>
<br>
<a href="http://twistedmatrix.com/trac/ticket/4372" target="_blank">http://twistedmatrix.com/trac/ticket/4372</a><br>
<br>
The patch which eliminates old log rotation will probably get rid of<br>
your CPU problem too.<br>
<font color="#888888"><br>
-J<br>
</font><div><div></div><div class="h5"><br>
On Fri, Apr 9, 2010 at 2:35 AM, Paul Goins <<a href="mailto:general@vultaire.net">general@vultaire.net</a>> wrote:<br>
> There may not be a clear answer to this problem, and the answer may or<br>
> may not be Twisted-specific. I'm just trying to fish for ideas here.<br>
><br>
> The server I'm working on suffers from extremely high CPU time spent in<br>
> the logging functions. I'm spending between 30 and 40% of all CPU time<br>
> just in twisted.python.log.msg.<br>
><br>
> Describing the environment:<br>
><br>
> We use DailyLogFiles for file rotation along with the<br>
> PythonLoggingObserver to allow for logLevel support. (Of course, this<br>
> gives us significant overhead from Python's complex logging<br>
> architecture; maybe we should drop this...)<br>
><br>
> On a 1000 request test of this server, we generate 58,274 calls to<br>
> t.p.log.msg. There's room for cleanup, but there's lots of pressure to<br>
> keep many of the log calls we have for forensic purposes, so we can only<br>
> cut this back so far.<br>
><br>
> Anyway, does anyone have any ideas for speedups? Any stories from<br>
> experience especially? Shots in the dark are welcome. ;-)<br>
><br>
> -<br>
> Paul Goins<br>
><br>
> _______________________________________________<br>
> Twisted-Python mailing list<br>
> <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
> <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
><br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br></div></div></div>