Ugh. A while back, my hard drive died. I was running gentoo, built from stage 1. It was pretty zippy.
Since then, I got my hard drive back. I installed gentoo from stage 3. There shouldn't be that much of a difference, right?
I installed azureus bittorrent client recently. Oh my. 99% CPU usage with only 400 connections. My system is only an athlon xp 2200/pc3200 1gig ram, it's not a monster machine, but that's excessive. So I installed ktorrent, which is a client written in C++. Same thing. The system was bogged down so bad running at 99% cpu usage. I installed Andrew Morton's kernel, and it was almost useless under high CPU usage. I switched to Con Kolivas's, and the system is once again totally usable at 99. Joy. However, why is AZU using so much? As well as ktorrent? Lets see..
I did an strace on the program.
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
49.69 0.008476 2 3867 gettimeofday
39.09 0.006669 133 50 select
WHOA!
Are any programmers around? Let's see, the point of select is to _SAVE_ cpu time by adding sockets to a socket listener instead of polling, wasting CPU cycles looping repeatedly. And gettimeofday()? What. That's like the equivalent of getting tick counts under windows, something apps do in any loop, something that should not take any significant CPU time really. The same top two functions held true for Azureus. What the heck? This is a new problem. AZU never used this much CPU time.
Where should I start trying to iron out this issue? I don't really want to get rid of gentoo, but something is definatly wrong.
