Mac OS X http://blog.samat.org/taxonomy/term/81/0 en Quick and easy network bandwidth benchmarking on Linux and MacOS X http://blog.samat.org/2009/03/15/quick-and-easy-network-bandwidth-benchmarking-on-linux-and-macos-x <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>A couple years ago, I setup my first gigabit Ethernet network. I wanted to test just how fast it could go with the equipment I gave it (that is, the NICs, cabling, and switches it operated on). Gigabit Ethernet, theoretically, can operate at 1000 Mbit/sec. This translates to 119.209 MiB/sec, units your <span class="caps">OS</span> typically displays when doing downloads (1000 Mbit/sec / 8 / 2^20). How close is your network setup to that maximum? Copying files between PCs, while being a very &#8220;real world&#8221; test, will be limited by how fast your disks can read or write. A specialized tool is&nbsp;needed.</p> <p>While many system benchmark suites include network testing tools, most are not easily separate from their suites, and are not easy to install and&nbsp;use.</p> <p>Enter <a href="http://netstrain.sourceforge.net/">NetStrain</a>. It&#8217;s a very simple C application for Linux and MacOS X designed to stress network connections. Unfortunately, it&#8217;s not included in most Linux distributions or MacOS X, so you need to download and compile it&nbsp;yourself.</p> <p>After compiling, use is simple. One machine acts as a server, and another machine acts as a client. Start the server first&nbsp;with:</p> <p><code> netstraind -4 9999 </code></p> <p>This starts a server using IPv4 networking on port 9999 (use a different port if you know this is in use; remember to pick one above 1024 if you&#8217;re not running as root). On your client machine, start the client connect to the server (assumed to be running on <span class="caps">IP</span> 192.168.1.2 and port&nbsp;9999):</p> <p><code> netstrain -4 192.168.1.2 9999 send </code></p> <p>NetStrain will then try to send as much over your network connection as it can as long as the client is running. NetStrain is very spartan, so there are not a lot of options. In addition to sending, you may want to test receiving, as well simultaneously sending and receiving. Check NetStrain&#8217;s <span class="caps">README</span> for&nbsp;details.</p> <p>Most likely, you will not get anything near 119.209 MiB/sec&#8212;but hopefully, you&#8217;ll get better speeds than a normal 100 Mbit connection to make everything&nbsp;worthwhile.</p> <p>What if you want to make things faster (without buying newer, better hardware)? There are many parameters you can tune on your operating system&#8217;s networking stack. However, in most modern operating systems, most of them are already set, or are automatically configured (e.g. <span class="caps">TCP</span> window scaling). The one major tunable is something called <span class="caps">MTU</span> (Maximum Transmission&nbsp;Unit).</p> <p>Data is transferred over Ethernet in packets; the <span class="caps">MTU</span> defines the size of those packets. A larger packet size means fewer packets are needed to send the same amount of data, reducing the amount of processing that needs to be done by your computer, switches, and routers. Your computer&#8217;s <span class="caps">NIC</span>, switches, and routers need to support large-size MTUs, a feature often advertised as &#8220;Ethernet jumbo frames.&#8221; Jeff Atwood wrote an article on <a href="http://www.codinghorror.com/blog/archives/001232.html">the promise and perils of jumbo frames</a> that you may want to read if you&#8217;re&nbsp;interested.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-1 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Topic:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/tag/Linux" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Linux</a></div><div class="field-item odd"><a href="/tag/Computer-Hardware" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Computer Hardware</a></div><div class="field-item even"><a href="/tag/HPC" typeof="skos:Concept" property="rdfs:label skos:prefLabel">High Performance Computing</a></div><div class="field-item odd"><a href="/tag/Mac-OS-X" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Mac OS X</a></div></div></div> Sun, 15 Mar 2009 20:55:14 +0000 Samat Jain 154 at http://blog.samat.org