Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 344875 - net-misc/iperf server takes 100% cpu
Summary: net-misc/iperf server takes 100% cpu
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-10 04:52 UTC by Oo.et.oO
Modified: 2013-09-05 16:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
init.d/iperf (iperf,541 bytes, text/plain)
2013-01-24 17:25 UTC, Ben Kohler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oo.et.oO 2010-11-10 04:52:26 UTC
when started from init script, iperf server takes 100% of cpu.  this happens whether a client is connected or not

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-10 14:10:58 UTC
Please post your `emerge --info' too.
Comment 2 Oo.et.oO 2010-11-10 15:25:23 UTC
Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.30-gentoo-r4 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r4-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E4600_@_2.40GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 06 Nov 2010 10:45:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.4_p6-r1, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests ccache distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/ http://mirror.datapipe.net/gentoo http://gentoo.osuosl.org/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages/"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/usr/local/portage/tmpdir"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sunrise /usr/portage/local/layman/ibm-internal /usr/portage/local/erict"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi afs aim alsa amarok amd64 apache2 apic apm arch_perfmon asf aspell automount avi bash-completion beagle bluetooth bts bzip2 cdparanoia cdr clflush cli cmov constant_tsc cpudetection cracklib crypt cups cx16 cx8 cxx dbus de dga directfb divx dri ds_cpl dts dv dvd dvdnav dvdr dvdread enca encode est evo evolution exif fame fbcon firefox flac fortran fpu ftp fxsr gdbm gif gimp gimpprint glib gmedia gnome-keyring gphoto2 gpm gtk gtkhtml hal hddtemp ht iconv inotify ipod jabber java javascript jpeg keyring kpathsea lahf_lm lame latex ldap libcaca libnotify live lm lm_sensors loop-aes lzma lzo mad mca mce meanwhile mmap mmx mmx2 mmxext mng modules monitor mozilla mp2 mp3 mp4 mp4live mpeg mplayer msn msr mtrr mudflap multilib musepack musicbrainz mysql ncurses nptl nptlonly nsplugin nx offensive ogg opengl openmp oscar pae pam pat pbe pcre pda pdf pebs perl pge php plotutils pmu png pni pppd prediction pse pse36 pth pulseaudio python qt3support qt4 quicktime readline realmedia rep_good rtc samba sdk sensord sep session smp sound spell ss sse sse2 ssl ssse3 startup-notification subtitles svg syscall sysfs tcpd tetex theora threads tiff tivo tm tm2 truetype tsc unicode urandom usb v4l v4l2 vim-syntax vme vorbis wmf wmp x264 xanim xine xorg xpm xprint xscreensaver xtpr xulrunner xv xvid xvmc yahoo zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIRC_DEVICES="atiusb" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" SANE_BACKENDS="genesys gt68xx" USERLAND="GNU" VIDEO_CARDS="radeon radeonhd vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Oo.et.oO 2010-11-10 15:38:42 UTC
bit more digging...  doesn't go to 100% cpu on server side until first client connects.   afterwards always stays at 100% cpu.  hogs so much of it, that ssh and x11vnc can't/don't accept clients.  even after clients have disconnected.  new iperf clients can, however, connect.  
it seems the first connection does not take 100% cpu.  somewhere around just under 50% (dual core system).  after first client session completes, if i start another, cpu usage jumps to 100%, or near it, and remains there.

i think i'll report upstream

i don't see a decent logging/debug option for this thing on the server side.
Comment 4 Oo.et.oO 2010-11-10 15:39:39 UTC
oh.  and it always, always takes the server two requests (through init.d) to stop.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2010-11-10 16:45:26 UTC
(In reply to comment #3)
> bit more digging...  doesn't go to 100% cpu on server side until first client
> connects.  

That isn't the problem, although it shouldn't perhaps use the CPU that much at all.

> afterwards always stays at 100% cpu.

That's what I am seeing here too. It doesn't happen when I run iperf -s on one system and iperf -c on the other, though, so I guess our init.d script is at fault here.
Comment 6 Ben Kohler gentoo-dev 2013-01-24 17:25:42 UTC
Created attachment 336740 [details]
init.d/iperf

This bug is still happening, it's triggered by a combination of USE=threads and the -D option to run as a daemon.  We can work around this by omitting -D and letting start-stop-daemon background the process.

I have attached a new init script with these changes, and it works here but I'm inexperienced with start-stop-daemon myself so it may need some tweaking.
Comment 7 Tiziano Müller (RETIRED) gentoo-dev 2013-09-05 16:23:11 UTC
Done in -r2. The problem still somewhat persists: after a client disconnects I still see a high CPU usage from the server (~40%).
But since iperf-2 is not developed anymore and there is iperf-3 (although alpha/beta) available I would say this workaround is fine enough.

@netmon: I hope you didn't mind me doing that, you can of course assign any bugs resulting from this to me, resp. CC me.