Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to test network throughput of a server to/from itself (it's a lonnnng story!).

I love Iperf and use it across the network, but, I just can't figure out how to bind it to a single interface and only listen via that.

From the documentation, I would assume that this would work: iperf -B eth0 -s to bind one instance to eth0, then in another session: iperf -B eth1 -c ip.of.eth.1.

This doesn't work at all, and actually fails. If I use the ip instead of interface, it does work, but, throughput is at 29Gb/s - so, unless there is some magic going on where by I have a super server with a 30Gb/s card, I am guessing that I am not even touching the network and this is just going locally.

Can anyone help me here, or know of a better test/tool?

share|improve this question
    
There is an existing post on this topic at stackoverflow.com/questions/2734144/… –  dwurf Apr 25 '12 at 12:52
    
I can say that I looked around thoroughly, but, never thought of checking Stack Overflow for this! Reading now. –  William Hilsum Apr 25 '12 at 12:58
    
Google-Fu: I didn't get any love till I googled "disable loopback linux". Turns out people try to do that for all the same reasons as you have :) –  dwurf Apr 25 '12 at 13:18

1 Answer 1

up vote 1 down vote accepted

Yes, this traffic is transferred locally without reaching your physical interfaces. It is transferred using the loopback interface. The kernel detects that the destination is a local one, so the traffic is looped back to the machine itself without going through eth0 or eth1.

share|improve this answer
    
I guessed this is what the issue was, just didn't know it was via the loopback - you just gave me the idea of disabling the loopback interface - however, this didn't help and now I can't even get the big speed! Also tried going via a switch instead of going direct (port to port).. Do you know another tool that can help? At the moment, I am thinking of just using another machine... However, I really want to try and keep it to just one if possible. –  William Hilsum Apr 25 '12 at 12:40
    
Try putting the interfaces on different subnets, and ensure that ip forwarding is disabled. Just a thought! –  dwurf Apr 25 '12 at 12:46
    
@WilliamHilsum: I think it can be done by some ARP trick. –  Khaled Apr 25 '12 at 12:49
    
I am certain this could be solved by editing the routing table, but, I just ran out of time and in the end, I just used a second server! Marking as answer though as it explained the problem and got me the closest... If someone else writes an actual answer on how to fix, I will switch the answer to that. –  William Hilsum Jul 1 '12 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.