<?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>Racker Hacker &#187; kernel</title>
	<atom:link href="http://rackerhacker.com/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://rackerhacker.com</link>
	<description>Words of wisdom from a server administrator</description>
	<lastBuildDate>Tue, 07 Feb 2012 14:07:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Xen 4.1 on Fedora 15 with Linux 3.0</title>
		<link>http://rackerhacker.com/2011/08/05/xen-4-1-on-fedora-15-with-linux-3-0/</link>
		<comments>http://rackerhacker.com/2011/08/05/xen-4-1-on-fedora-15-with-linux-3-0/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 04:34:06 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2367</guid>
		<description><![CDATA[If you haven't noticed already, full Xen dom0 support was added in the Linux 3.0 kernel. This means there's no longer a need to drag patches forward from old kernels and work from special branches and git repositories when building a kernel for dom0. Something else you might not have noticed is that the Fedora [...]<p><a href="http://rackerhacker.com/2011/08/05/xen-4-1-on-fedora-15-with-linux-3-0/">Xen 4.1 on Fedora 15 with Linux 3.0</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you haven't noticed already, <a href="http://blog.xen.org/index.php/2011/06/02/xen-celebrates-full-dom0-and-domu-support-in-linux-3-0/">full Xen dom0 support</a> was added in the <a href="http://kernelnewbies.org/Linux_3.0">Linux 3.0 kernel</a>.  This means there's no longer a need to drag patches forward from old kernels and work from special branches and git repositories when building a kernel for <a href="http://wiki.xensource.com/xenwiki/Dom0">dom0</a>.</p>
<p>Something else you might not have noticed is that the Fedora kernel team has <a href="https://admin.fedoraproject.org/updates/kernel-2.6.40-4.fc15">quietly slipped Linux 3.0</a> into Fedora 15's update channels in disguise.  Click that link, scroll down, and you'll see <em>"Rebase to 3.0. Version reports as 2.6.40 for compatibility with older userspace."</em>  Although I'm not a fan of calling something what it isn't (2.6.40 doesn't exist on kernel.org), I can understand some of the reasoning behind the choice.</p>
<p>This change makes the Xen installation on Fedora 15 pretty trivial.  To get started, update your kernel to the latest if you're not already on Fedora's 2.6.40 kernels:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum -y upgrade kernel</pre></div></div>

<p>We need three more packages (quite a few dependencies will roll in with them):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum -y install xen libvirt python-virtinst</pre></div></div>

<p>The xen package reels in the hypervisor itself along with libraries and command line tools (like xl and xm).  Libvirt gives us easy access to VM management with the <code>virsh</code> command and python-virtinst gives us the handy <code>virt-install</code> command to make OS installations easy.</p>
<p>Once those packages are installed, we need to make some adjustments in your grub configuration.  Open <code>/boot/grub/menu.lst</code> in your text editor of choice and add something like this at the bottom:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">title Fedora + Xen (2.6.40-4.fc15.x86_64)
        root (hd0,1)
	kernel /boot/xen.gz
        module /boot/vmlinuz-2.6.40-4.fc15.x86_64 ro root=/dev/sda1
        module /boot/initramfs-2.6.40-4.fc15.x86_64.img</pre></div></div>

<p>Ensure that the <code>root (hd0,1)</code> is applicable to your system (adjust it if it isn't).  Also, check the kernel version to ensure it matches your installed kernel and adjust the <code>root=</code> portion to match your root volume.  Flip the <code>default</code> line to a value which will boot your new grub entry and ensure the timeout is set to a reasonable number if you need to temporarily switch back to your original grub entry at boot time.  (Hey, we all make mistakes.)</p>
<p>I take one extra precaution and change the <code>UPDATEDEFAULT=yes</code> line to <code>no</code> in <code>/etc/sysconfig/kernel</code>.  This ensures that future kernel updates don't trample the entry you've just made.  Keep in mind that you'll need to manually update your grub configuration when you do kernel upgrades later.</p>
<p>Cross your fingers and reboot.  If your system doesn't reboot properly, reboot it again and choose your old kernel from the grub menu.  Double-check your configuration for fat-fingering and give it another try.  If your system boots and pings but you have no output via a monitor, don't fret.  There's a <a href="http://marc.info/?l=linux-kernel&#038;m=131169794026271&#038;w=2">patch</a> for the problem which <a href="http://marc.info/?l=linux-kernel&#038;m=131169794026271&#038;w=2">should appear soon</a> in Linux 3.0.  The impatient can snag a kernel source RPM, add the patch file, and <a href="http://fedoraproject.org/wiki/Building_a_custom_kernel">build a local kernel</a> (or you can <a href="http://majorhayden.com/RPMS/kernel-3.0.0-1.mhayden.fc16/">download my local build</a> from when I did it).</p>
<p>Log in and verify that you booted into the dom0:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@xenbox ~]# xm dmesg | head -n 5
 __  __            _  _    _   _   ____     __      _ ____  
 \ \/ /___ _ __   | || |  / | / | |___ \   / _| ___/ | ___| 
  \  // _ \ '_ \  | || |_ | | | |__ __) | | |_ / __| |___ \ 
  /  \  __/ | | | |__   _|| |_| |__/ __/ _|  _| (__| |___) |
 /_/\_\___|_| |_|    |_|(_)_(_)_| |_____(_)_|  \___|_|____/</pre></div></div>

<p>Once you're done with that, make sure libvirtd is running:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">/etc/init.d/libvirtd start; chkconfig libvirtd on</pre></div></div>

<p>Try installing a VM:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">virt-install \
  --paravirt \
  --name=testvm \
  --ram=512 \
  --vcpus=4 \
  --file /dev/vmstorage/testvm \
  --graphics vnc,port=5905 --noautoconsole \
  --autostart --noreboot \
  --location=http://mirrors.kernel.org/debian/dists/squeeze/main/installer-amd64/</pre></div></div>

<p>You should have a VM installation underway pretty quickly and it will be visible via port 5905 on the local host.  Enjoy the power and freedom of your brand new <a href="http://en.wikipedia.org/wiki/Hypervisor#Classification">type 1 hypervisor</a>.</p>
<p><a href="http://rackerhacker.com/2011/08/05/xen-4-1-on-fedora-15-with-linux-3-0/">Xen 4.1 on Fedora 15 with Linux 3.0</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/08/05/xen-4-1-on-fedora-15-with-linux-3-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Keep all old kernels when upgrading via yum</title>
		<link>http://rackerhacker.com/2011/06/16/keep-all-old-kernels-when-upgrading-via-yum/</link>
		<comments>http://rackerhacker.com/2011/06/16/keep-all-old-kernels-when-upgrading-via-yum/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 12:50:46 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2336</guid>
		<description><![CDATA[Some might call me paranoid, but I get nervous when my package manager automatically removes a kernel. I logged into my Fedora 15 VM this morning and found this: ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: kernel x86_64 2.6.35.13-92.fc14 updates 22 M Removing: kernel x86_64 2.6.35.11-83.fc14 @updates 104 M &#160; Transaction Summary ================================================================================ Install [...]<p><a href="http://rackerhacker.com/2011/06/16/keep-all-old-kernels-when-upgrading-via-yum/">Keep all old kernels when upgrading via yum</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Some might call me paranoid, but I get nervous when my package manager automatically removes a kernel.  I logged into my Fedora 15 VM this morning and found this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">================================================================================
 Package        Arch           Version                   Repository        Size
================================================================================
Installing:
 kernel         x86_64         2.6.35.13-92.fc14         updates           22 M
Removing:
 kernel         x86_64         2.6.35.11-83.fc14         @updates         104 M
&nbsp;
Transaction Summary
================================================================================
Install       1 Package(s)
Remove        1 Package(s)</pre></div></div>

<p>Fedora 15's default behavior is to keep three kernels: the latest one and the two previous versions.  However, this behavior may be counter-productive if you compile your own modules, or if you have compatibility issues with subsequent kernel versions.</p>
<p>You can change how yum handles kernel packages with some simple changes to your <code>/etc/yum.conf</code>.  The <code>installonly_limit</code> option controls how many old packages are kept:</p>
<blockquote><p><strong>installonly_limit</strong> Number of packages listed  in  installonlypkgs to  keep  installed at the same time. Setting to 0 disables this feature. Default is '0'.</p></blockquote>
<p>I disabled the functionality altogether by setting <code>installonly_limit</code> to 0:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">#installonly_limit=3
installonly_limit=0</pre></div></div>

<p>It's important to keep in mind that you will need to purge these packages from your system yourself now.  Kernel packages can occupy a fair amount of disk space, so make a note to go back and clean them up when you no longer need them.</p>
<p><a href="http://rackerhacker.com/2011/06/16/keep-all-old-kernels-when-upgrading-via-yum/">Keep all old kernels when upgrading via yum</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2011/06/16/keep-all-old-kernels-when-upgrading-via-yum/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tap into your Linux system with SystemTap</title>
		<link>http://rackerhacker.com/2010/12/07/tap-into-your-linux-system-with-systemtap/</link>
		<comments>http://rackerhacker.com/2010/12/07/tap-into-your-linux-system-with-systemtap/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 02:27:02 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[advanced]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[systemtap]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=2005</guid>
		<description><![CDATA[One of the most interesting topics I've seen so far during my RHCA training at Rackspace this week is SystemTap. In short, SystemTap allows you to dig out a bunch of details about your running system relatively easily. It takes scripts, converts them to C, builds a kernel module, and then runs the code within [...]<p><a href="http://rackerhacker.com/2010/12/07/tap-into-your-linux-system-with-systemtap/">Tap into your Linux system with SystemTap</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the most interesting topics I've seen so far during my <a href="https://www.redhat.com/courses/rh442_red_hat_enterprise_system_monitoring_and_performance_tuning/">RHCA</a> training at <a href="http://rackspace.com/">Rackspace</a> this week is <a href="http://sourceware.org/systemtap/">SystemTap</a>.  In short, SystemTap allows you to dig out a bunch of details about your running system relatively easily.  It takes scripts, converts them to C, builds a kernel module, and then runs the code within your script.</p>
<p><strong><span style="color: #D42020;">HOLD IT:</span> The steps below are <em>definitely</em> not meant for those who are new to Linux.  Utilizing SystemTap on a production system is a bad idea -- it can chew up significant resources while it runs and it can also cause a running system to kernel panic if you're not careful with the packages you install.</strong></p>
<p>These instructions will work well with Fedora, CentOS and Red Hat Enterprise Linux.  Luckily, the SystemTap folks put together some instructions for <a href="http://sourceware.org/systemtap/wiki/SystemtapOnDebian">Debian</a> and <a href="http://sourceware.org/systemtap/wiki/SystemtapOnUbuntu">Ubuntu</a> as well.</p>
<p>Before you can start working with SystemTap on your RPM-based distribution, you'll need to get some prerequisites together:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum install gcc systemtap systemtap-runtime systemtap-testsuite kernel-devel
yum --enablerepo=*-debuginfo install kernel-debuginfo kernel-debuginfo-common</pre></div></div>

<p><strong><span style="color: #D42020;">WHOA THERE:</span> Ensure that the kernel-devel and kernel-debuginfo* packages that you install via yum match up with your running kernel.  If there's a newer kernel available from your yum repo, yum will pull that one.  If it's been a while since you updated, you'll either need to upgrade your current kernel to the latest and reboot or you'll need to hunt down the corresponding kernel-devel and kernel-debuginfo* packages from a repository.  <em>Installing the wrong package version can lead to kernel panics.</em>  Also, bear in mind that the debuginfo packages are quite large: almost 200MB in Red Hat/CentOS and almost 300MB in Fedora.</strong></p>
<p>You can't write the script in just any language.  SystemTap uses an odd syntax to get things going:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">#! /usr/bin/env stap
probe begin { println(&quot;hello world&quot;) exit () }</pre></div></div>

<p>Just run the script with <code>stap</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># stap -v helloworld.stp 
Pass 1: parsed user script and 73 library script(s) using 94380virt/21988res/2628shr kb, in 140usr/30sys/167real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) using 94776virt/22516res/2692shr kb, in 10usr/0sys/5real ms.
Pass 3: using cached /root/.systemtap/cache/bc/stap_bc368822da380b943d4e845ee15ed047_773.c
Pass 4: using cached /root/.systemtap/cache/bc/stap_bc368822da380b943d4e845ee15ed047_773.ko
Pass 5: starting run.
hello world
Pass 5: run completed in 0usr/20sys/285real ms.</pre></div></div>

<p>The <code>systemtap-testsuite</code> package gives you a <strong>tubload</strong> of extremely handy SystemTap scripts.  For example:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># cd /usr/share/systemtap/testsuite/systemtap.examples/io/
# stap iotime.stp
15138470 6351 (httpd) access /usr/share/cacti/index.php read: 0 write: 0
15142243 6351 (httpd) access /usr/share/cacti/include/auth.php read: 0 write: 0
15143780 6351 (httpd) access /usr/share/cacti/include/global.php read: 0 write: 0
15144099 6351 (httpd) access /etc/cacti/db.php read: 0 write: 0
15187641 6351 (httpd) access /usr/share/cacti/lib/adodb/adodb.inc.php read: 106486 write: 0
15187664 6351 (httpd) iotime /usr/share/cacti/lib/adodb/adodb.inc.php time: 218
15194965 6351 (httpd) access /usr/share/cacti/lib/adodb/adodb-time.inc.php read: 0 write: 0
15195692 6351 (httpd) access /usr/share/cacti/lib/adodb/adodb-iterator.inc.php read: 0 write: 0
   ... output continues ...</pre></div></div>

<p>The <code>iotime.stp</code> script dumps out the reads and writes occurring on the system in real time.  After starting the script above, I accessed my cacti instance on the server and immediately started seeing some reads as apache began picking up PHP files to parse.</p>
<p>Consider a situation in which you need to decrease interrupts on a Linux machine.  This is vital for laptops and systems that need to remain in low power states.  Some might suggest powertop<a href="http://www.lesswatts.org/projects/powertop/"> for that, but why not give SystemTap a try?</a></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># cd /usr/share/systemtap/testsuite/systemtap.examples/interrupt/
# stap interrupts-by-dev.stp 
        ohci_hcd:usb3 :      1
        ohci_hcd:usb4 :      1
            hda_intel :      1
                 eth0 :      2
                 eth0 :      2
                 eth0 :      2
                 eth0 :      2
                 eth0 :      2
                 eth0 :      2</pre></div></div>

<p>On this particular system, it's pretty obvious that the ethernet interface is causing a lot of interrupts.</p>
<p>If you want more examples, keep hunting around in the systemtap-testsuite package (remember <code>rpm -ql systemtap-testsuite</code>) or review the <a href="http://sourceware.org/systemtap/examples/">giant list of examples</a> on SystemTap's site.</p>
<p><em>Thanks again to Phil Hopkins at Rackspace for giving us a detailed explanation of system profiling during training.</em></p>
<p><a href="http://rackerhacker.com/2010/12/07/tap-into-your-linux-system-with-systemtap/">Tap into your Linux system with SystemTap</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/12/07/tap-into-your-linux-system-with-systemtap/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Keep web servers in sync with DRBD and OCFS2</title>
		<link>http://rackerhacker.com/2010/12/02/keep-web-servers-in-sync-with-drbd-and-ocfs2/</link>
		<comments>http://rackerhacker.com/2010/12/02/keep-web-servers-in-sync-with-drbd-and-ocfs2/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 02:01:12 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1846</guid>
		<description><![CDATA[The guide to redundant cloud hosting that I wrote recently will need some adjustments as I've fallen hard for the performance and reliability of DRBD and OCFS2. As a few of my sites were gaining in popularity, I noticed that GlusterFS simply couldn't keep up. High I/O latency and broken replication threw a wrench into [...]<p><a href="http://rackerhacker.com/2010/12/02/keep-web-servers-in-sync-with-drbd-and-ocfs2/">Keep web servers in sync with DRBD and OCFS2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>The <a href="/redundant-cloud-hosting-configuration-guide/">guide to redundant cloud hosting</a> that I wrote recently will need some adjustments as I've fallen hard for the performance and reliability of DRBD and OCFS2.  As a few of my sites were gaining in popularity, I noticed that GlusterFS simply couldn't keep up.  High I/O latency and broken replication threw a wrench into my love affair with GlusterFS and I knew there had to be a better option.<br />
<div id="attachment_1987" class="wp-caption alignright" style="width: 310px"><a href="http://rackerhacker.com/wp-content/uploads/2010/12/drbd-and-ocfs2-e1291337653403.png"><img src="http://rackerhacker.com/wp-content/uploads/2010/12/drbd-and-ocfs2-e1291337653403.png" alt="DRBD, OCFS2, apache, varnish, and LVS" title="DRBD, OCFS2, apache, varnish, and LVS" width="300" height="300" class="size-full wp-image-1987" /></a><p class="wp-caption-text">Diagram of two web nodes with a replicated filesystem using DRBD &#038; OCFS2</p></div>I've shared my configuration with my coworkers and I've received many good questions about it.  Let's get to the Q&#038;A:</p>
<p><b>How does the performance compare to GlusterFS?</b><br />
On Gluster's best days, the data throughput speeds were quite good, but the latency to retrieve the data was often much too high.  Page loads on this site were taking upwards of 3-4 seconds with GlusterFS latency accounting for well over 75% of the delays.  For small files, GlusterFS's performance was about 20-25x slower than accessing the disk natively.  The performance hit for DRBD and OCFS2 is usually between 1.5-3x for small files and difficult to notice for large file transfers.</p>
<p><b>Couldn't you keep the data separate and then sync it with rsync?</b><br />
Everyone knows that rsync can be a resource consuming monster and it seems wasteful to call rsync via a cron job to keep my data in sync.  There are some periods of the day where the actual data on the web root rarely changes.  There are other times where it changes rapidly and I'd end up with nodes out of sync for a few minutes.</p>
<p>To get the just-in-time synchronization that I want, I'd have to run rsync at least once a minute.  If the data isn't changing over a long period, rsync would end up crushing the disk and consuming CPU for no reason.  DRBD only syncs data when data changes.  Also, all reads with DRBD are done locally.  This makes is a highly efficient and effective choice for instant synchronization.</p>
<p><b>Why OCFS2? Isn't that overkill?</b><br />
When you use DRBD in dual-primary mode, it's functionally equivalent to having a raw storage device (like a SAN) mounted in two places.  If you threw an ext4 filesystem onto a LUN on your SAN and then mounted it on two different servers, you'd be in bad shape very quickly.  Non-clustered filesystems like ext3 or ext4 can't handle being mounted in more than one environment.</p>
<p>OCFS2 is built primarily to be mounted in more than one place and it comes with its own distributed locking manager (DLM).  The configuration files for OCFS2 are extremely simple and you mount it like any other filesystem.  It's been part of the mainline Linux kernel since 2.6.19.</p>
<p><b>What happens when you lose one of the nodes?</b><br />
The configuration shown above can operate with just one node in an emergency.  When the failed node comes back online, DRBD will resync the block device and you can mount the OCFS2 filesystem as you normally would.</p>
<p><b>You're using an Oracle product? Really?</b><br />
You've got me there.  I'm not a fan of how they treat the open source community with regards to some of their projects, but the OCFS2 filesystem is robust, free, and it meets my needs.</p>
<p><b>Where's the how-to?</b><br />
It's coming soon!  Stay tuned.</p>
<p><a href="http://rackerhacker.com/2010/12/02/keep-web-servers-in-sync-with-drbd-and-ocfs2/">Keep web servers in sync with DRBD and OCFS2</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/12/02/keep-web-servers-in-sync-with-drbd-and-ocfs2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A simple guide to redundant cloud hosting</title>
		<link>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/</link>
		<comments>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 00:41:16 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cloud servers]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1771</guid>
		<description><![CDATA[Today, on my 28th birthday, I'm finally delivering on a promise to my readers which I made about two months ago. I've written a guide on how to host a web application redundantly in a cloud environment. While it's still a bit of a rough draft, it should be a good starting point for those [...]<p><a href="http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/">A simple guide to redundant cloud hosting</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Today, on my 28th birthday, I'm finally delivering on a promise to my readers which I made about two months ago.  I've <a href="/redundant-cloud-hosting-configuration-guide/">written a guide</a> on how to host a web application redundantly in a cloud environment.  While it's still a bit of a rough draft, it should be a good starting point for those who haven't worked in virtualized environments before.  Also, it may show some of the more experienced systems administrators a new way to do things.</p>
<p>The guide: <a href="/redundant-cloud-hosting-configuration-guide/">Redundant Cloud Hosting Guide</a></p>
<p>As always, if you find anything in the guide that needs improvement, I'm all ears. <img src='http://rackerhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/">A simple guide to redundant cloud hosting</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/08/17/a-simple-guide-to-redundant-cloud-hosting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Legacy tty1 and block device support for Xen guests with pvops kernels</title>
		<link>http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/</link>
		<comments>http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/#comments</comments>
		<pubDate>Fri, 14 May 2010 13:24:34 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1408</guid>
		<description><![CDATA[The discussions about the paravirt_ops, or "pvops", support in upstream kernels at Xen Summit 2010 last month really piqued my interest. Quite a few distribution maintainers have gone to great lengths to keep Xen domU support in their kernels and it's been an uphill battle. Some kernels, such as Ubuntu's linux-ec2 kernels, have patches from [...]<p><a href="http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/">Legacy tty1 and block device support for Xen guests with pvops kernels</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>The discussions about the <a href="http://wiki.xensource.com/xenwiki/XenParavirtOps">paravirt_ops</a>, or "pvops", support in upstream kernels at <a href="http://www.xen.org/xensummit/xensummit_spring_2010.html">Xen Summit 2010</a> last month really piqued my interest.</p>
<p>Quite a few distribution maintainers have gone to great lengths to keep Xen domU support in their kernels and it's been an uphill battle.  Some kernels, such as Ubuntu's <a href="http://packages.ubuntu.com/lucid/linux-ec2">linux-ec2</a> kernels, have patches from 2.6.18 dragged forward into 2.6.32 and even 2.6.33.  It certainly can't be enjoyable to keep dragging those patches forward into new kernel trees.</p>
<p>The paravirt_ops support for Xen guests was added in 2.6.23 and continues to be included and improved in the latest kernel trees.  However, there are two significant problems with these new kernels if you're trying to work with legacy environments:</p>
<ul>
<li>the console is on <code>hvc0</code>, not <code>tty1</code></li>
<li>block devices are now <code>/dev/xvdX</code> rather than <code>/dev/sdX</code></li>
</ul>
<p>If you only have a few guests, these changes are generally pretty easy.  Switching the console just requires some changes to your inittab or upstart configurations.  Changing the block device names requires changes to the guest's Xen configuration file and <code>/etc/fstab</code> within the guest itself.</p>
<p>Considering the <a href="http://www.rackspacecloud.com/cloud_hosting_products/servers">amount of environments</a> I work with daily at Rackspace, changing the guest configuration is definitely not an option.  I needed a way to keep the console and block devices unchanged so that our customers could have a consistent experience on our infrastructure.</p>
<p>Luckily, <a href="http://blog.warma.dk/">Soren Hansen</a> offered to pitch in and a solution became apparent.  Through some <a href="http://lists.xensource.com/archives/html/xen-devel/2010-05/msg00712.html">relatively small patches</a>, the legacy console and block device support was available in the latest 2.6.32 version (2.6.32.12 as of this post's writing).</p>
<p>So far, I've tested x86_64 and i386 versions of 2.6.32.12 with the console and block device patches.  It's gone through its paces on Xen 3.0.3, 3.1.2, 3.3.0 and 3.4.2.  All revisions of Fedora, CentOS, Ubuntu, Debian, Gentoo and Arch made within the last two years are working well with the new kernels.</p>
<p><a href="http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/">Legacy tty1 and block device support for Xen guests with pvops kernels</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/05/14/legacy-tty1-and-block-device-support-for-xen-guests-with-pvops-kernels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A New Year System Administrator Inspiration</title>
		<link>http://rackerhacker.com/2010/01/03/a-new-year-system-administrator-inspiration/</link>
		<comments>http://rackerhacker.com/2010/01/03/a-new-year-system-administrator-inspiration/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 02:53:53 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[general advice]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1104</guid>
		<description><![CDATA[Happy New Year! I certainly hope it's a great one for you, your family, and your business. As the new year begins, I figured it would be a good time to sit down and answer a question that I hear very often: How do I become a better systems administrator? The best way to become [...]<p><a href="http://rackerhacker.com/2010/01/03/a-new-year-system-administrator-inspiration/">A New Year System Administrator Inspiration</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Happy New Year!  I certainly hope it's a great one for you, your family, and your business.  As the new year begins, I figured it would be a good time to sit down and answer a question that I hear very often:</p>
<p><em>How do I become a better systems administrator?</em></p>
<p>The best way to become a better systems administrator is to <strong>fully understand the theory</strong> of what's happening in your server's environment.</p>
<p>What do I mean by that?  Learn why things aren't happening as you expected and think about all of the factors that could possibly be involved.  Instead of thinking purely about cause and effect, you'll find it much easier and rewarding to consider everything inside and outside your environment before you make any changes.</p>
<p>This still may be a little difficult to fully understand, so he's an example.  Let's say you're handling an issue where a customer can't reach a website hosted on their server.  When you ask them for more details, they might give you the dreaded reply: "It's not coming up."  Start by making a mental list of the problems that are easiest to check:</p>
<ul>
<li>Is the web server daemon running?</li>
<li>If a database server is being used, is it running and accessible?</li>
<li>Is there a software/hardware firewall blocking port 80?</li>
<li>Is a script stuck on the server tying up resources?</li>
<li>Could there be a DNS resolution problem?</li>
<li>Is the server up?</li>
<li>Did a switch fail?</li>
<li>Is the server's hard disk out of space?</li>
<li>Can the customer reach other websites like Google or Yahoo?</li>
<li>If SELinux is involved, have the appropriate contexts been set?</li>
<li>Could the site be a target of a denial of service attack?</li>
<li>Has the server reached its connection tracking limit?</li>
</ul>
<p>Of course, this is a relatively short list, but these are all easy to check.  If you're thinking about cause and effect, you might only consider the web server daemon and some basic network issues.  By considering all of the other factors that may be related, you've ensured that all of the basics are covered before you consider more complex problems.</p>
<p>Most systems administrators have taken an error message and tossed it in en masse into Google before.  Occasionally, no results will appear for the search.  If you find yourself in this situation, try to understand the individual parts of the error message.  Work outward from what you know already.  You should know which daemon said it, and you may have an idea of what the application was doing when the error occurred.  Take time to consider what the daemon is trying to tell you within the context of what it was doing at the time.</p>
<p>One of the easiest ways to force yourself to be immersed into this way of thinking is to host applications for non-technical people.  You'll find that many customers want things done differently, and they're all at different levels of technical aptitude.  Some may find it a frustrating experience at first, but you'll think yourself later.  It will force you to consider all aspects of how a server operates since you might not always know what's happening within a customer's application.</p>
<p>As always, if you find yourself stumbling, remember to ask your peers and colleagues.  Even if they haven't seen the particular issue, they will probably be able to guide you closer to the solution you seek.</p>
<p><a href="http://rackerhacker.com/2010/01/03/a-new-year-system-administrator-inspiration/">A New Year System Administrator Inspiration</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2010/01/03/a-new-year-system-administrator-inspiration/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Parse kernel.org changelogs with wget and grep</title>
		<link>http://rackerhacker.com/2009/12/15/parse-kernel-org-changelogs-with-wget-and-grep/</link>
		<comments>http://rackerhacker.com/2009/12/15/parse-kernel-org-changelogs-with-wget-and-grep/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 23:14:47 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[one liner]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=1063</guid>
		<description><![CDATA[I try to keep up with the latest kernel update from kernel.org, but parsing through the output can be a pain if there are a lot of changes taking place. Here's a handy one-liner to make it easier to read: wget --quiet -O - http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.31.8 &#124; grep -A 4 ^commit &#124; grep -B 1 &#34;^--&#34; [...]<p><a href="http://rackerhacker.com/2009/12/15/parse-kernel-org-changelogs-with-wget-and-grep/">Parse kernel.org changelogs with wget and grep</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I try to keep up with the latest kernel update from <a href="http://kernel.org/">kernel.org</a>, but parsing through the output can be a pain if there are a lot of changes taking place.  Here's a handy one-liner to make it easier to read:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">wget --quiet -O - http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.31.8 | grep -A 4 ^commit | grep -B 1 &quot;^--&quot; | grep -v &quot;^--&quot;</pre></div></div>

<p>It should give you some output like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">    Linux 2.6.31.8
    ext4: Fix potential fiemap deadlock (mmap_sem vs. i_data_sem)
    signal: Fix alternate signal stack check
    SCSI: scsi_lib_dma: fix bug with dma maps on nested scsi objects
    SCSI: osd_protocol.h: Add missing #include
    SCSI: megaraid_sas: fix 64 bit sense pointer truncation
    ..</pre></div></div>

<p><a href="http://rackerhacker.com/2009/12/15/parse-kernel-org-changelogs-with-wget-and-grep/">Parse kernel.org changelogs with wget and grep</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/12/15/parse-kernel-org-changelogs-with-wget-and-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 11 httpd: alloc_listener: failed to get a socket for (null)</title>
		<link>http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/</link>
		<comments>http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:14:02 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=981</guid>
		<description><![CDATA[If you use Fedora 11 in a virtualized environment, you may have seen this error recently if you've updated to apr-1.3.8-1: [root@f11 ~]# /etc/init.d/httpd start Starting httpd: [Fri Aug 14 17:05:24 2009] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null) Syntax error on line 134 of /etc/httpd/conf/httpd.conf: Listen setup failed [FAILED] The [...]<p><a href="http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/">Fedora 11 httpd: alloc_listener: failed to get a socket for (null)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>If you use Fedora 11 in a virtualized environment, you may have seen this error recently if you've updated to apr-1.3.8-1:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[root@f11 ~]# /etc/init.d/httpd start
Starting httpd: [Fri Aug 14 17:05:24 2009] [crit] (22)Invalid argument: alloc_listener: failed to get a socket for (null)
Syntax error on line 134 of /etc/httpd/conf/httpd.conf:
Listen setup failed
                                                           [FAILED]</pre></div></div>

<p>The issue is related to three kernel calls that are used in apr-1.3.8-1: accept4(), dup3() and epoll_create1().  Without these calls, apache is unable to start.  </p>
<p><strong><u>Update on August 17, 2009:</u> the Fedora team has <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516331#c12">pushed apr-1.3.8-2 into the stable repositories</a> for Fedora 11, which eliminates the need for the temporary fix shown below.</strong></p>
<p><strong>Deprecated solution:</strong> There is a <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516331">bug open</a> with the Fedora team, and there is a <a href="https://bugzilla.redhat.com/show_bug.cgi?id=516331#c10">temporary fix</a> available:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">yum --enablerepo=updates-testing update apr</pre></div></div>

<p><a href="http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/">Fedora 11 httpd: alloc_listener: failed to get a socket for (null)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/08/14/fedora-11-httpd-alloc_listener-failed-to-get-a-socket-for-null/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two great signals: SIGSTOP and SIGCONT</title>
		<link>http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/</link>
		<comments>http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:16:19 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[sigcont]]></category>
		<category><![CDATA[signals]]></category>
		<category><![CDATA[sigstop]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=920</guid>
		<description><![CDATA[The best uses I've found for the SIGSTOP and SIGCONT signals are times when a process goes haywire, or when a script spawns too many processes at once. You can issue the signals like this: kill -SIGSTOP [pid] kill -SIGCONT [pid] Wikipedia has great definitions for SIGSTOP: When SIGSTOP is sent to a process, the [...]<p><a href="http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/">Two great signals: SIGSTOP and SIGCONT</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>The best uses I've found for the SIGSTOP and SIGCONT signals are times when a process goes haywire, or when a script spawns too many processes at once.</p>
<p>You can issue the signals like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kill -SIGSTOP [pid]
kill -SIGCONT [pid]</pre></div></div>

<p>Wikipedia has great definitions for <a href="http://en.wikipedia.org/wiki/SIGSTOP">SIGSTOP</a>:</p>
<blockquote><p>When SIGSTOP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes. SIGSTOP cannot be caught or ignored.</p></blockquote>
<p>and <a href="http://en.wikipedia.org/wiki/SIGCONT">SIGCONT</a>:</p>
<blockquote><p>When SIGSTOP or SIGTSTP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell, among other purposes.</p></blockquote>
<p>In short, SIGSTOP tells a process to "hold on" and SIGCONT tells a process to "pick up where you left off".  This can work really well for rsync jobs since you can pause the job, clear up some space on the destination device, and then resume the job.  The source rsync process just thinks that the destination rsync process is taking a long time to respond.</p>
<p>In the <code>ps</code> output, stopped processes will have a status containing <em>T</em>.  Here's an example with <code>crond</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># kill -SIGSTOP `pgrep crond`
# ps aufx | grep crond
root      3499  0.0  0.0 100328  1236 ?        Ts   Jun11   0:01 crond
# kill -SIGCONT `pgrep crond`
# ps aufx | grep crond
root      3499  0.0  0.0 100328  1236 ?        Ss   Jun11   0:01 crond</pre></div></div>

<p><a href="http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/">Two great signals: SIGSTOP and SIGCONT</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/06/15/two-great-signals-sigstop-and-sigcont/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linux: emergency reboot or shutdown with magic commands</title>
		<link>http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/</link>
		<comments>http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 02:07:06 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sysctl]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=727</guid>
		<description><![CDATA[Most linux distributions use some type of mechanism to gracefully stop daemons and unmount storage volumes during a reboot or shutdown. It's most commonly done via scripts that will wait for each daemon to shut down gracefully before proceeding to the next daemon. As we know, sometimes servers misbehave due to things put them through, [...]<p><a href="http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/">Linux: emergency reboot or shutdown with magic commands</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Most linux distributions use some type of mechanism to gracefully stop daemons and unmount storage volumes during a reboot or shutdown.  It's most commonly done via scripts that will wait for each daemon to shut down gracefully before proceeding to the next daemon.</p>
<p>As we know, sometimes servers misbehave due to things put them through, and you can quickly end up in a situation where things are going badly.  I'm talking about the type of situation where you're connected via SSH to a server that controls phone lines for five million people and it sits in a tiny building 400 miles away from the nearest human being.  We're talking bad.  If you issue a plain <code>reboot</code> command, it might not even make it that far.  Once SSH stops running, you're going to be out of luck.</p>
<p>If you find yourself in this situation (and I hope you won't!), you have some options to get your way with a misbehaving server remotely.  You can force an immediate reboot with the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/kernel/sysrq 
echo b &gt; /proc/sysrq-trigger</pre></div></div>

<p><span style="color: #ff0000;"><strong>WHOA THERE!</strong></span> This is pretty much the same as pressing the reset button on the server (if equipped).  No daemons will be shut down gracefully, no filesystem sync will occur, and you may get the wrath of a fsck (or worse, a non-booting server) upon reboot.  To do things a little more carefully, read on.</p>
<p>These are called <a href="http://en.wikipedia.org/wiki/Magic_SysRq_key">magic commands</a>, and they're pretty much synonymous with holding down Alt-SysRq and another key on older keyboards.  Dropping <code>1</code> into <code>/proc/sys/kernel/sysrq</code> tells the kernel that you want to enable SysRq access (it's usually disabled).  The second command is equivalent to pressing Alt-SysRq-b on a QWERTY keyboard.</p>
<p>There's a better way of rebooting a misbehaving server that <a href="http://en.wikipedia.org/wiki/Magic_SysRq_key#.22Raising_Elephants.22_mnemonic_device">Wikipedia shows</a> with the mnemonic "Reboot Even If System Utterly Broken":</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">unRaw      (take control of keyboard back from X),  
 tErminate (send SIGTERM to all processes),
 kIll      (send SIGKILL to all processes), 
  Sync     (flush data to disk),
  Unmount  (remount all filesystems read-only),
reBoot.</pre></div></div>

<p>I can't vouch for this actually working, but I'm interested to try it.  <strong>UPDATE:</strong> I've been told that doing this series of commands with ReiserFS is a very bad idea.</p>
<p>If you want to shut the machine down entirely (please think about it before using this on a remote system):</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/kernel/sysrq 
echo o &gt; /proc/sysrq-trigger</pre></div></div>

<p>If you want to keep SysRq enabled all the time, you can do that with an entry in your server's <code>sysctl.conf</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">kernel.sysrq = 1</pre></div></div>

<p><a href="http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/">Linux: emergency reboot or shutdown with magic commands</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/01/29/linux-emergency-reboot-or-shutdown-with-magic-commands/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Linux: Adjust storage kernel module load order</title>
		<link>http://rackerhacker.com/2009/01/26/linux-adjust-storage-kernel-module-load-order/</link>
		<comments>http://rackerhacker.com/2009/01/26/linux-adjust-storage-kernel-module-load-order/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 20:40:01 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=717</guid>
		<description><![CDATA[I set up a system at home that has two SATA controllers: one is on the motherboard (nvidia chipset), while the other is on a Silicon Image SATA card that has three eSATA ports. Here is the relevant lspci output: root@storageserver:~# lspci &#124; grep ATA 00:08.0 IDE interface: nVidia Corporation MCP61 SATA Controller (rev a2) [...]<p><a href="http://rackerhacker.com/2009/01/26/linux-adjust-storage-kernel-module-load-order/">Linux: Adjust storage kernel module load order</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>I set up a system at home that has two SATA controllers: one is on the motherboard (nvidia chipset), while the other is on a Silicon Image SATA card that has three eSATA ports.  Here is the relevant <code>lspci</code> output:</p>
<pre>root@storageserver:~# lspci | grep ATA
00:08.0 IDE interface: nVidia Corporation MCP61 SATA Controller (rev a2)
00:08.1 IDE interface: nVidia Corporation MCP61 SATA Controller (rev a2)
03:00.0 Mass storage controller: Silicon Image, Inc. SiI 3132 Serial ATA Raid II Controller (rev 01)</pre>
<p>There are two primary drives connected to the onboard controller and four connected to the controller card.  One of the primary drives on the onboard controller contains the operating system (Ubuntu, in this case), while the other drive is blank.</p>
<p>When the system booted, the sata_sil24 driver for the add-on card always loaded before the sata_nv drivers for the onboard storage controller:</p>
<pre>kernel: [    4.125598] sata_sil24 0000:03:00.0: version 1.1
kernel: [    4.126102] sata_sil24 0000:03:00.0: PCI INT A -> Link[APC6] -> GSI 16 (level, low) -> IRQ 16
kernel: [    4.126161] sata_sil24 0000:03:00.0: setting latency timer to 64
kernel: [    4.129472] scsi0 : sata_sil24
kernel: [    4.129635] scsi1 : sata_sil24
kernel: [    8.293762] sata_nv 0000:00:08.0: version 3.5
kernel: [    8.293779] sata_nv 0000:00:08.0: PCI INT A -> Link[APSI] -> GSI 20 (level, low) -> IRQ 20
kernel: [    8.293829] sata_nv 0000:00:08.0: setting latency timer to 64
kernel: [    8.296764] scsi2 : sata_nv
kernel: [    8.296905] scsi3 : sata_nv
kernel: [    9.285034] sata_nv 0000:00:08.1: PCI INT B -> Link[APSJ] -> GSI 21 (level, low) -> IRQ 21
kernel: [    9.285074] sata_nv 0000:00:08.1: setting latency timer to 64
kernel: [    9.285161] scsi4 : sata_nv
kernel: [    9.286015] scsi5 : sata_nv</pre>
<p>After specifying an explicit order in /etc/modules and /etc/modprobe.conf, I wasn't able to see any changes.  The sata_sil24 driver still loaded before the onboard sata_nv driver.  Luckily, a <a href="http://twitter.com/Twirrim">very wise person</a> on <a href="http://twitter.com/">Twitter</a> <a href="http://twitter.com/Twirrim/status/1148330615">gave me a strategy</a> that <a href="http://tinyurl.com/d53f6e">worked just fine</a>.</p>
<p>I added sata_sil24 to the bottom of my /etc/modprobe.d/blacklist file first.  Then, in /etc/modules, I listed sata_nv first, followed by sata_sil24.  When the system booted, I got the result that I wanted:</p>
<pre>kernel: [    3.982909] sata_nv 0000:00:08.0: version 3.5
kernel: [    3.982931] sata_nv 0000:00:08.0: PCI INT A -> Link[APSI] -> GSI 20 (level, low) -> IRQ 20
kernel: [    3.982993] sata_nv 0000:00:08.0: setting latency timer to 64
kernel: [    3.984497] scsi0 : sata_nv
kernel: [    3.986013] scsi1 : sata_nv
kernel: [    4.971755] sata_nv 0000:00:08.1: PCI INT B -> Link[APSJ] -> GSI 21 (level, low) -> IRQ 21
kernel: [    4.971799] sata_nv 0000:00:08.1: setting latency timer to 64
kernel: [    4.973153] scsi2 : sata_nv
kernel: [    4.974031] scsi3 : sata_nv
kernel: [   15.988862] sata_sil24 0000:03:00.0: version 1.1
kernel: [   15.989454] sata_sil24 0000:03:00.0: PCI INT A -> Link[APC6] -> GSI 16 (level, low) -> IRQ 16
kernel: [   15.989511] sata_sil24 0000:03:00.0: setting latency timer to 64
kernel: [   15.990201] scsi6 : sata_sil24
kernel: [   15.991523] scsi7 : sata_sil24</pre>
<p>The sata_nv driver is loading first, and Ubuntu boots off of it without an issue.  The sata_sil24 driver loads next so that the drives connected to the card show up lower in the boot order.</p>
<p><i>Many thanks to <a href="http://twitter.com/Twirrim">@Twirrim</a> on Twitter for the suggestion!</i></p>
<p><a href="http://rackerhacker.com/2009/01/26/linux-adjust-storage-kernel-module-load-order/">Linux: Adjust storage kernel module load order</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2009/01/26/linux-adjust-storage-kernel-module-load-order/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Reducing inode and dentry caches to keep OOM killer at bay</title>
		<link>http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/</link>
		<comments>http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 00:44:20 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[emergency]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=635</guid>
		<description><![CDATA[When it comes to frustrating parts of the Linux kernel, OOM killer takes the cake. If it finds that applications are using too much memory on the server, it will kill process abruptly to free up memory for the system to use. I spent much of this week wrestling with a server that was in [...]<p><a href="http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/">Reducing inode and dentry caches to keep OOM killer at bay</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>When it comes to frustrating parts of the Linux kernel, <a href="http://linux-mm.org/OOM_Killer">OOM killer</a> takes the cake. If it finds that applications are using too much memory on the server, it will kill process abruptly to free up memory for the system to use.  I spent much of this week wrestling with a server that was in the clutches of OOM killer.</p>
<p>There are a few processes on the server that keep it fairly busy.  Two of the processes are vital to the server's operation - if they are stopped, lots of work is required to get them running properly again.  I found that a certain java process was being killed by OOM killer regularly, and another perl process was being killed occasionally.</p>
<p>Naturally, my disdain for java made me think that the java process was the source of the issue.  The process was configured to use a small amount of RAM, so it was ruled out.  The other perl process used even less memory, so it was ruled out as well.  When I checked the sysstat data with sar, I found that the server was only using about 2-3GB out of 4GB of physical memory at the time when OOM killer was started.  <em>At this point, I was utterly perplexed.</em></p>
<p>I polled some folks around the office and gathered some ideas.  After putting some ideas together, I found that the server was actually caching too much data in the <code>ext3_inode_cache</code> and <code>dentry_cache</code>.  These caches hold recently accessed files and directories on the server, and they're purged as the files and directories become stale.  Since the operations on the server read and write large amounts of data locally and via NFS, I knew these caches had to be gigantic.  If you want to check your own caches, you can use the <code>slabtop</code> command.  For those who like things more difficult, you can also <code>cat</code> the contents of <code>/proc/slabinfo</code> and grep for the caches that are important to you.</p>
<p>An immense amount of Googling revealed very little, but I discovered a <a href="http://www.linuxinsight.com/proc_sys_vm_drop_caches.html">dirty hack</a> to fix the issue <strong>(don't run this yet)</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">echo 1 &gt; /proc/sys/vm/drop_caches  # free pagecache
     [OR]
echo 2 &gt; /proc/sys/vm/drop_caches  # free dentries and inodes
     [OR]
echo 3 &gt; /proc/sys/vm/drop_caches  # free pagecache, dentries and inodes
sync  # forces the dump to be destructive</pre></div></div>

<p><strong><u>There are huge consequences to dumping these caches and running <code>sync</code>.</u></strong>  If you are writing data at the time you run these commands, you'll actually be dumping the data out of the filesystem cache before it reaches the disk, which could lead to very bad things.</p>
<p>While discussing the issue with a coworker, he <a href="http://www.linuxinsight.com/proc_sys_vm_vfs_cache_pressure.html">found a different method</a> for correcting the issue that was <strong>much</strong> safer.  You can echo values into <strong>/proc/sys/vm/vfs_cache_pressure</strong> to tell the kernel what priority it should take when clearing out the inode/dentry caches.  LinuxInsight explains the range of values well:</p>
<blockquote><p>At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.</p></blockquote>
<p>In short, values less than 100 won't reduce the caches very much as all.  Values over 100 will signal to the kernel that you want to clear out the caches at a higher priority.  I found that no matter what value you use, the kernel clears the caches at a slow rate.  I've been using a value of 10000 on the server I talked about earlier in the article, and it has kept the caches down to a reasonable level.</p>
<p><a href="http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/">Reducing inode and dentry caches to keep OOM killer at bay</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/12/03/reducing-inode-and-dentry-caches-to-keep-oom-killer-at-bay/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Reduce disk I/O for small reads using memory</title>
		<link>http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/</link>
		<comments>http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 17:00:27 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[iowait]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/?p=316</guid>
		<description><![CDATA[Many applications that are used on a standard server perform quite a few of small writes to the disk (like MySQL or Apache). These writes can pile up and limit the performance of your applications. If you have kernel 2.6.9 or later, you can adjust how these small writes are handled to allow for better [...]<p><a href="http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/">Reduce disk I/O for small reads using memory</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Many applications that are used on a standard server perform quite a few of small writes to the disk (like MySQL or Apache).  These writes can pile up and limit the performance of your applications.  If you have kernel 2.6.9 or later, you can adjust how these small writes are handled to allow for better performance.</p>
<p>There's two main kernel variables to know:</p>
<p><strong>vm.dirty_ratio</strong> - The highest % of your memory that can be used to hold dirty data.  If you set this to a low value, the kernel will flush small writes to the disk more often.  Higher values allow the small writes to stack up in memory.  They'll go to the disk in bigger chunks.</p>
<p><strong>vm.dirty_background_ratio</strong> - The lowest % of your memory where pdflush is told to stop when it is writing dirty data.  You'll want to keep this set as low as possible.</p>
<p>These might confuse you.  In short, when your memory begins filling with little pieces of data that needs to be written to the disk, it will keep filling until it reaches the dirty_ratio.  At that point, pdflush will start up, and it will write data until it reduces the dirty data to the value set by dirty_background_ratio.</p>
<p>Stock 2.6.9 kernels have a dirty_background_ratio of 10% and a dirty_ratio of 40%.  Some distributions tweak these defaults to something different, so you may want to review the settings on your system.  On a system with heavy disk I/O, you can increase the dirty_ratio and reduce the dirty_background_ratio.  A little experimentation may be necessary to find the perfect setting for your server.</p>
<p>If you want to play with the variables, just use your standard echo:</p>
<p><code>echo 5 &gt; /proc/sys/vm/dirty_background_ratio<br />
echo 60 &gt; /proc/sys/vm/dirty_ratio</code></p>
<p>Once you've found the right setting, you can set it permanently by adding lines to your /etc/sysctl.conf:</p>
<p><code>vm.dirty_background_ratio = 5<br />
vm.dirty_ratio = 60</code></p>
<p>If you have a reliable server with a good RAID card and power supply, you could set the dirty_ratio to 100 and the dirty_background_ratio to 1.  This was recommended by a buddy of mine who runs quite a few servers running virtual machines.</p>
<p><a href="http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/">Reduce disk I/O for small reads using memory</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/08/07/reduce-disk-io-for-small-reads-using-memory/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rebuilding the initial ram disk (initrd)</title>
		<link>http://rackerhacker.com/2008/01/28/rebuilding-the-initial-ram-disk-initrd/</link>
		<comments>http://rackerhacker.com/2008/01/28/rebuilding-the-initial-ram-disk-initrd/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 18:23:39 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[command line]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2008/01/28/rebuilding-the-initial-ram-disk-initrd/</guid>
		<description><![CDATA[Installing new hardware may mean that new kernel need to be loaded when your server boots up. There's a two step process to making a new initrd file: First, add the appropriate line to your /etc/modules.conf or /etc/modprobe.conf which corresponds to your new kernel module. Next, rebuild the initial ram disk after making a backup [...]<p><a href="http://rackerhacker.com/2008/01/28/rebuilding-the-initial-ram-disk-initrd/">Rebuilding the initial ram disk (initrd)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Installing new hardware may mean that new kernel need to be loaded when your server boots up.  There's a two step process to making a new initrd file:</p>
<p><strong>First,</strong> add the appropriate line to your /etc/modules.conf or /etc/modprobe.conf which corresponds to your new kernel module.</p>
<p><strong>Next,</strong> rebuild the initial ram disk after making a backup of the current one:</p>
<p><code># cp /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img.bak<br />
# mkinitrd -f initrd-`uname -r`.img `uname -r`</code></p>
<p>Reboot the server now and make sure the new driver is loaded properly.</p>
<p><a href="http://rackerhacker.com/2008/01/28/rebuilding-the-initial-ram-disk-initrd/">Rebuilding the initial ram disk (initrd)</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/01/28/rebuilding-the-initial-ram-disk-initrd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ip_conntrack: table full, dropping packet</title>
		<link>http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet/</link>
		<comments>http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 18:26:40 +0000</pubDate>
		<dc:creator>Major Hayden</dc:creator>
				<category><![CDATA[Blog Posts]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet/</guid>
		<description><![CDATA[Last week, I found myself with a server under low load, but it couldn't make or receive network connections. When I ran dmesg, I found the following line repeating over and over: ip_conntrack: table full, dropping packet I'd seen this message before, but I headed over to Red Hat's site for more details. It turns [...]<p><a href="http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet/">ip_conntrack: table full, dropping packet</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></description>
			<content:encoded><![CDATA[<p>Last week, I found myself with a server under low load, but it couldn't make or receive network connections.  When I ran <code>dmesg</code>, I found the following line repeating over and over:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">ip_conntrack: table full, dropping packet</pre></div></div>

<p>I'd seen this message before, but I headed over to <a href="http://kbase.redhat.com/faq/FAQ_45_11238.shtm">Red Hat's site</a> for more details.  It turns out that the server was running iptables, but it was under a very heavy load and also handling a high volume of network connections.  Generally, the ip_conntrack_max is set to the total MB of RAM installed multiplied by 16.  However, this server had 4GB of RAM, but ip_conntrack_max was set to 65536:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># cat /proc/sys/net/ipv4/ip_conntrack_max
65536</pre></div></div>

<p>I logged into another server with 1GB of RAM (RHES 5, 32-bit) and another with 2GB of RAM (RHES 4, 64-bit), and both had ip_conntrack_max set to 65536.  I'm not sure if this is a known Red Hat issue, or if it's just set to a standard value out of the box.</p>
<p>If you want to check your server's current tracked connections, just run the following:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count</pre></div></div>

<p>If you want to adjust it (as I did), just run the following as root:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># echo 131072 &gt; /proc/sys/net/ipv4/ip_conntrack_max</pre></div></div>

<p><a href="http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet/">ip_conntrack: table full, dropping packet</a> is a post from: Major Hayden's <a href="http://rackerhacker.com">Racker Hacker</a> blog. 
<p>Thanks for following the blog via the RSS feed. Please don't copy my posts or quote portions of them without attribution.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://rackerhacker.com/2008/01/24/ip_conntrack-table-full-dropping-packet/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>

