[medusa] Re: CPU utilization optimization? PROBLEM FOUND!

Jim Fulton jim@d...
Sat, 07 Apr 2001 13:09:33 -0400


Weiss Blitz wrote:
> 
> Ok, I think I found the problem...
> 
> I developed a Medusa based instant messaging server running on a dual-
> processor Compaq Proliant box under Win2000 Server.
> 
> I noticed Medusa idled at 1-2%, one connection comes up and the CPU
> utilization jumps to 100%!
> 
> Found that the asyncore.py select loop was being pegged as soon as
> the first connection was made. Also noticed this was so because the
> asynchat.writable method was always returning a '1' even when the
> ac_out_buffer output buffer was empty. I replaced the 'is' operator
> with the '==' and it now seems to work normally.

Interesting. Did you have the select timeout set very low?

Jim

--
Jim Fulton mailto:jim@d... Python Powered! 
Technical Director (888) 344-4332 http://www.python.org 
Digital Creations http://www.digicool.com http://www.zope.org