Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

gettimeofday()/select() Using way too much CPU. What Broke?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
d13f00l
n00b
n00b
Posts: 26
Joined: Mon Aug 30, 2004 6:32 am

gettimeofday()/select() Using way too much CPU. What Broke?

  • Quote

Post by d13f00l » Thu Sep 15, 2005 1:56 am

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.
Top
d13f00l
n00b
n00b
Posts: 26
Joined: Mon Aug 30, 2004 6:32 am

  • Quote

Post by d13f00l » Thu Sep 15, 2005 3:42 am

I recompiled my kernel, switched the timer down to 250hz. I also switched to gcc 3.4.4, now futex() is doing it. Hrm.
Top
Post Reply

2 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic