<?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>Spind.net Blog &#187; Network</title>
	<atom:link href="http://blog.spind.net/tag/network/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.spind.net</link>
	<description>Stories from the trenches of System Administration</description>
	<lastBuildDate>Mon, 19 Dec 2011 09:21:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Sendmail and Postfix on the same server</title>
		<link>http://blog.spind.net/2009/01/13/sendmail-and-postfix-on-the-same-server/</link>
		<comments>http://blog.spind.net/2009/01/13/sendmail-and-postfix-on-the-same-server/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 09:07:05 +0000</pubDate>
		<dc:creator>hc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Alternatives]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Sendmail]]></category>

		<guid isPermaLink="false">http://blog.spind.net/?p=80</guid>
		<description><![CDATA[Recently I needed sendmail and sendmail-devel to compile some software, but when I installed Sendmail, it decided to make itself my preferred MTA &#8211; and I suddenly got the same feeling of powerlessness that accompany running Microsoft Windows. Newer Linux distributions offer the Alternatives system, which basically lets you choose between different installed software that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed <tt>sendmail</tt> and <tt>sendmail-devel</tt> to compile some software, but when I installed Sendmail, it decided to make itself my preferred MTA &#8211; and I suddenly got the same feeling of powerlessness that accompany running Microsoft Windows.</p>
<p>Newer Linux distributions offer the Alternatives system, which basically lets you choose between different installed software that serve the same purpose. If you&#8217;re running Sendmail and Postfix like me, you can use Alternatives to pick which MTA you prefer to use:</p>
<div class="codebox">$ /usr/sbin/alternatives</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:590px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">--</div></td></tr></tbody></table></div>
<p>config mta</p>
<p>There are 2 programs which provide &#8216;mta&#8217;.</p>
<p>  Selection    Command</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:590px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-----------------------------------------------</div></td></tr></tbody></table></div>
<p>*  1           /usr/sbin/sendmail.sendmail<br />
 + 2           /usr/sbin/sendmail.postfix</p>
<p>Enter to keep the current selection[+], or type selection number: 2
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.spind.net/2009/01/13/sendmail-and-postfix-on-the-same-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ethernet device, where art thou?</title>
		<link>http://blog.spind.net/2008/12/16/ethernet-device-where-art-thou/</link>
		<comments>http://blog.spind.net/2008/12/16/ethernet-device-where-art-thou/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 09:09:50 +0000</pubDate>
		<dc:creator>hc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Fedora10]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[udev]]></category>

		<guid isPermaLink="false">http://blog.spind.net/?p=77</guid>
		<description><![CDATA[Today I lost my Ethernet devices, probably as a result of upgrading the apartment server from Fedora 9 to Fedora 10. The culprit turned out to be the service responsible for dynamic device management &#8211; udev. These symptoms started showing up in the logfile: Dec 16 07:26:12 server kernel: udev: renamed network interface eth1 to [...]]]></description>
			<content:encoded><![CDATA[<p>Today I lost my Ethernet devices, probably as a result of upgrading the apartment server from Fedora 9 to Fedora 10. The culprit turned out to be the service responsible for dynamic device management &#8211; <em>udev</em>. These symptoms started showing up in the logfile:</p>
<div class="codebox">
Dec 16 07:26:12 server kernel: udev: renamed network interface eth1 to eth4<br />
Dec 16 07:26:12 server kernel: udev: renamed network interface eth0 to eth2<br />
Dec 16 07:26:12 server kernel: udev: renamed network interface eth1 to eth5
</div>
<p>The <em>udev</em> daemon creates and renames devices according to configuration files in <tt>/etc/udev/rules.d/</tt> called <em>rules</em>. One of them &#8211; <tt>70-persistent-net.rules</tt> &#8211; specifically handles network devices. This file was screwed up badly by Anaconda, and had dupes and network devices from a previous hardware configuration. I cleaned up this file, so it had only contained rules that matched the hardware addresses of the installed network devices:</p>
<div class="codebox">
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:1e:8c:85:cd:e2&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth0&#8243;<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:50:da:21:e3:34&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth1&#8243;<br />
SUBSYSTEM==&#8221;net&#8221;, ACTION==&#8221;add&#8221;, DRIVERS==&#8221;?*&#8221;, ATTR{address}==&#8221;00:01:02:24:6d:91&#8243;, ATTR{type}==&#8221;1&#8243;, KERNEL==&#8221;eth*&#8221;, NAME=&#8221;eth2&#8243;
</div>
<p>Various external <em>&#8220;plug-and-play&#8221;</em> helpers may add newly found network devices to this file, so if your network devices start changing names, you might want to check <tt>/etc/udev/rules.d/70-persistent-net.rules</tt>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.spind.net/2008/12/16/ethernet-device-where-art-thou/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweaking Linux network parameters</title>
		<link>http://blog.spind.net/2008/11/28/tweaking-linux-network-parameters/</link>
		<comments>http://blog.spind.net/2008/11/28/tweaking-linux-network-parameters/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 11:02:59 +0000</pubDate>
		<dc:creator>hc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Tuning]]></category>

		<guid isPermaLink="false">http://blog.spind.net/?p=38</guid>
		<description><![CDATA[Random browsing takes you weird places, and suddenly I found myself reading up on tweaks for the Linux IPv4 TCP stack &#8211; many of them actually recommended by Sun. Your mileage may vary, and you probably should read up on every single option before you apply it. All options go in /etc/sysctl.conf. Allow the TCP [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nene.snix.com/wiki/index.php/Base_Software_Installation">Random browsing</a> takes you weird places, and suddenly I found myself reading up on tweaks for the Linux IPv4 TCP stack &#8211; many of them actually recommended by <a href="http://www.sun.com/">Sun</a>. Your mileage may vary, and you probably should read up on every single option before you apply it. All options go in <tt>/etc/sysctl.conf</tt>.</p>
<p>Allow the TCP stack to reuse sockets in the TIME-WAIT state:</p>
<div class="codebox">
# Allow reuse/recycling of TIME-WAIT sockets for new connections:<br />
net.ipv4.tcp_tw_reuse = 1<br />
net.ipv4.tcp_tw_recycle = 1
</div>
<p>TCP Timestamps are enabled per default, and enables calculation of RTT in a more accurate way (see RFC 1323) than the retransmission timeout. IBM suggests this should be enabled for performance, but others suggest disabling it and saving 12 bytes header overhead. We&#8217;ll leave it on:</p>
<div class="codebox">
# Enable TCP timestamps:<br />
net.ipv4.tcp_timstamps = 1
</div>
<p>Enable selective acknowledgment, which improves performance by selectively acknowledging packets received out of order (causing the sender to retransmit only the missing segments). Should be enabled for wide area network communication, but it can increase CPU utilization. Also enable Forward Acknowledgment (FACK), which operates with Selective Acknowledgment (SACK) to reduce congestion:</p>
<div class="codebox">
# Enable TCP Selective/Forward Acknowledgements:<br />
net.ipv4.tcp_sack = 1<br />
net.ipv4.tcp_fack = 1
</div>
<p>To use large packet windows (over 64Kb), you should enable window scaling as defined by RFC 1323:</p>
<div class="codebox">
# Enable support for large TCP windows:<br />
net.ipv4.tcp_window_scaling = 1
</div>
<p>Lowering the FIN Timeout value will shorten the TIME_WAIT state, freeing up resources for new connections. It is recommended when running applications that constantly create a lot of new connections &#8211; ie. a web server. The default is 60, and Sun recommends a value in the 15-30 range.</p>
<div class="codebox">
# Lower FIN timeout (default: 60):<br />
net.ipv4.tcp_fin_timeout = 15
</div>
<p>Tweak the TCP KeepAlive values:</p>
<div class="codebox">
# Wait time between isAlive interval probes (default: 75, recommended: 15-30):<br />
net.ipv4.tcp_keepalive_intvl = 15<br />
# Number of probes before timing out (default: 9, recommended: 5):<br />
net.ipv4.tcp_keepalive_probes = 5
</div>
<p>The default maximum for send/receive windows is 128Kb and it&#8217;s recommended to boost this to 8Mb:</p>
<div class="codebox">
# Maximum TCP Send Window:<br />
net.core.wmem_max = 8388608<br />
# Maximum TCP Receive Window:<br />
net.core.rmem_max = 8388608
</div>
<p>Also tweak the IPv4 rcv/snd buffers to use a maximum of 8Mb:</p>
<div class="codebox">
# Memory reserved for TCP rcv buffers (default: 4Kb 85Kb 4Mb):<br />
net.ipv4.tcp_rmem = 4096 87380 8388608<br />
# Memory reserved for TCP snd buffers (default: 4Kb 16Kb 4Mb):<br />
net.ipv4.tcp_wmem = 4096 87380 8388608
</div>
<p>If you&#8217;re using a lot of connections, you should make more local ports available. Default range gives a total of 28232 ports available. Increasing this range to 4096-65535 will give you 61439 local ports:</p>
<div class="codebox">
# Available local port range (default: 32768 61000):<br />
net.ipv4.ip_local_port_range = 4096 65536
</div>
<p>Apart from hopefully boosting overall network performance, the tweaks above also lowered the number of sockets in the TIME_WAIT state from 300 to around 50.</p>
<p>Any comments and/or corrections are welcome.</p>
<p>Sources:</p>
<ul>
<li><a href="http://www.ibm.com/developerworks/linux/library/l-hisock.html">Boost Socket Performance on Linux</a> on <a href="http://www.ibm.com/">www.ibm.com</a></li>
<li><a href="http://www.speedguide.net/read_articles.php?id=121">Linux Tweaking</a> on <a href="http://www.speedguide.net/">www.speedguide.net</a></li>
<li><a href="http://www.performancewiki.com/linux-tuning.html">Linux tuning tips with sample settings</a> on <a href="http://www.performancewiki.com">www.performancewiki.com</a></li>
<li><a href="http://ipsysctl-tutorial.frozentux.net/">Ipsysctl-tutorial</a> on <a href="http://frozentux.net/">frozentux.net</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.spind.net/2008/11/28/tweaking-linux-network-parameters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

