[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: tor eating CPU time



On Fri, Jan 28, 2005 at 12:56:12PM +0100, Valient Gough wrote:
> I upgraded to 0.0.9.3 last weekend, and it dropped tor's average CPU 
> usage by almost half.

Great.

> However thing have been slowly getting worse.  Saturday stats show about 
> 30% CPU average usage, increasing slowly to a little over 40% on Wed, 
> then about 50% by Thursday, and about 12 hours ago tor jumped to 100% 
> cpu usage and has not taken a rest since then.
> 
> The strange thing is that this doesn't correlate with traffic served.  
> Tor traffic has been steadily averaging about 200k/sec, and started 
> dropping about 12 hours ago by as much as a factor of 2 (much higher 
> variation though).  So, CPU time increased, but network traffic decreased...
> 
> Looking through my server monitoring logs, I don't see any correlation 
> against network usage or number of open TCP connections.   I'm about to 
> restart TOR, but before I get into the habbit of periodic restarts, is 
> there anything I can do to get information about the problem?

As near as I can tell it, Tor spends most of its time doing SSL handshakes
with other Tors (either clients or servers).

I don't think anybody has given me profiling output lately (gprof,
oprofile, etc) on a really busy server though. If you wanted to give
that a go and let me know where it spends its time _once it gets to 100%
cpu use_, that would be really handy.

For example, I can imagine a couple situations where it would start
doing linear lookups on a list of circuits that has grown really large --
and it would do such a lookup for each cell that it handles. But until
I know what's going on, trying to optimize everything is just going to
increase complexity.

Thanks,
--Roger