<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Santiance &#187; TCP</title>
	<atom:link href="http://santiance.com/tag/tcp/feed/" rel="self" type="application/rss+xml" />
	<link>http://santiance.com</link>
	<description>Kristopher Ives&#039;s Developer Notes</description>
	<lastBuildDate>Tue, 31 Aug 2010 23:00:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Linux TCP Settings for Comcast &amp; Using ionice</title>
		<link>http://santiance.com/2009/09/linux-tcp-settings-for-comcast-using-ionice/</link>
		<comments>http://santiance.com/2009/09/linux-tcp-settings-for-comcast-using-ionice/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:40:22 +0000</pubDate>
		<dc:creator>Kristopher Ives</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://santiance.com/?p=224</guid>
		<description><![CDATA[It&#8217;s been mailed and blogged about to death, but I&#8217;ll explain how to increase you TCP performance for usage on a laptop or notebook that will having heavy bandwidth usage. With a common cable provider and wireless device ratings these days you can get about 2 MB/sec connections. However, it&#8217;s unlikely you&#8217;ll find many HTTP [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been <a title="TCP Tuning for Broadband (Mailing List)" href="https://lists.ubuntu.com/archives/ubuntu-users/2007-November/129976.html" target="_blank">mailed</a> and <a title="Linux Tune Network Stack" href="http://www.cyberciti.biz/faq/linux-tcp-tuning/" target="_blank">blogged</a> <a title="Tweak Kernel Variables in sysctl.conf" href="http://perfector.wordpress.com/2008/04/23/tweak-kernel-variables-in-sysctlconf/" target="_blank">about</a> <a title="Configure Debian TCP Performance" href="http://vps.net/forum/forums/tutorials-how-tos/425-configure-debian-tcp-ip-performance" target="_blank">to</a> <a title="How To Increase TCP Speed In Ubunut" href="http://ubuntumanual.org/posts/10/how-to-increase-internet-speed-in-ubuntu" target="_blank">death</a>, but I&#8217;ll explain how to increase you TCP performance for usage on a laptop or notebook that will having heavy bandwidth usage. With a common cable provider and wireless device ratings these days you can get about 2 MB/sec connections. However, it&#8217;s unlikely you&#8217;ll find many HTTP servers that are willing to give you that much bandwidth in a single connection, but BitTorrent (and possibly zysnc, jigdo, and other distribution systems) may make heavy interchange between many servers sending a lot of TCP packets.</p>
<p>The default configurations for TCP in Ubuntu and Debian are good, but they aren&#8217;t profiled to meat your specific connection. Last I checked I believe they are defaulted to a DSL-like connection, which is probably somewhere in the middle-ground between dial-up and high performance broadband. Here are some simple additions you can make to your <code>/etc/sysctl.conf</code> file (as root):</p>
<pre>net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.ipv4.tcp_wmem = 4096 87380 524288
net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 0
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_ecn = 0
net.ipv4.route.flush = 1</pre>
<p>The easiest way to make these configuration changes and apply them is to press ALT+F2 and run <code>gksudo gedit /etc/sysctl.conf</code> (you can copy and paste that), which will open up the text editor. Paste the above changes at the end of the file, save, and exit. Now press ALT+F2 again and enter <code>gksudo sysctl -p</code> to apply these changes. If you want to see what these commands are doing you&#8217;ll have to press the <em>Run in Terminal</em> button instead of just <em>Run</em>.</p>
<p>Another trick is using <code>ionice</code> to give different processes more priority on reading and writing to your file system. A good example is the <em>Transmission</em> torrent client, which I prefer to run in the background most of the time. You have to get the Process ID (PID) by using the <em>System Monitor</em>, which can be ran from the <em>Administration</em> menu or by pressing ALT+F2 <code>gnome-system-monitor</code>. Go to the process list and find the name of the program (<code>transmission</code> in this example), copy the PID, and then press ALT+F2 <code>gksudo ionice -c 3 -p 1234</code> where <em>1234</em> is instead the PID. I used <code>3</code> here to make it use <em>Idle</em> scheduling, but you can use <code>1</code>, <code>2</code>, and <code>3</code> for varying degrees. See <code>man ionice</code> for how that works in detail.</p>
]]></content:encoded>
			<wfw:commentRss>http://santiance.com/2009/09/linux-tcp-settings-for-comcast-using-ionice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
