Here is the combined fixes from iperf-users list. Begin forwarded message: Date: Thu, 30 Aug 2007 15:55:22 -0400 From: "Andrew Gallatin" <gallatin@gmail.com> To: iperf-users@dast.nlanr.net Subject: [PATCH] performance fixes for non-linux Hi, I've attached a patch which gives iperf similar performance to netperf on my FreeBSD, MacOSX and Solaris hosts. It does not seem to negatively impact Linux. I only started looking at the iperf source yesterday, so I don't really expect this to be integrated as is, but a patch is worth a 1000 words :) Background: On both Solaris and FreeBSD, there are 2 things slowing iperf down: The gettimeofday timestamp around each socket read/write is terribly expensive, and the sched_yield() or usleep(0) causes iperf to take 100% of the time (system time on BSD, split user/system time on Solaris and MacOSX), which slows things down and confuses the scheduler. To address the gettimeofday() issue, I treat TCP different than UDP, and TCP tests behave as though only a single (huge) packet was sent. Rather then ending the test based on polling gettimeofday() timestamps, an interval timer / sigalarm handler is used. I had to increase the packetLen from an int to a max_size_t. To address the sched_yield/usleep issue, I put the reporter thread to sleep on a condition variable. For the TCP tests at least, there is no reason to have it running during the test and it is best to just get it out of the way rather than burning CPU in a tight loop. I've also incorporated some fixes from the FreeBSD ports collection: --- include/headers.h use a 64-bit type for max_size_t --- compat/Thread.c oldTID is not declared anywhere. Make this compile (seems needed for at least FreeBSD & MacOSX) --- src/Client.cpp BSDs can return ENOBUFS during a UDP test when the socket buffer fills. Don't exit when this happens. I've run the resulting iperf on FreeBSD, Solaris, MacOSX and Linux, and it seems to work for me. It is nice not to have a 100% CPU load when running an iperf test across a 100Mb/s network. Drew
| Fernando Luis | [PATCH] affinity is not defined in non-smp kernels - i386 (v2) |
| FUJITA Tomonori | Re: Integration of SCST in the mainstream Linux kernel |
| Tvrtko A. Ursulin | Out of tree module using LSM |
| Andi Kleen | [PATCH] [9/58] x86_64: Always use builtin memcpy on gcc 4.3 |
git: | |
| Dmitry Kakurin | Re: [RFC] Convert builin-mailinfo.c to use The Better String Library. |
| Linus Torvalds | Re: several quick questions |
| Scott Chacon | [PATCH] add a 'pre-push' hook |
| Junio C Hamano | Re: Change set based shallow clone |
| Richard Stallman | Real men don't attack straw men |
| Paul Greidanus | Re: [Fwd: Open-Hardware] |
| Richard Daemon | Nfsen and php problems...? |
| Marco Peereboom | Re: Real men don't attack straw men |
| David Miller | [GIT]: Networking |
| David Miller | Re: 2.6.25-rc8: FTP transfer errors |
| Steve Wise | pktgen question |
| James Bottomley | Re: [BUG] New Kernel Bugs |
