defunkt/resque — pull request #865 by jonhyman (2013-03-17 14:46:14+00:00)
Title: Fixes #862 (verified on 2.6.32-amazon-xen-r3 kernel)

After investigating a few things, it seems like the cause of the swap space issue was that the child process wasn't signaling an exit. I am not sure why this matters (since it's in a block) but at least on the 2.6.32-amazon-xen-r3 kernel on my EC2 machines, it mattered a lot.

Here is a graph of one of my servers' I/O utilization before the fix, after the fix, undoing the fix, and re-applying the fix. I also watched all executions via [iotop](http://guichaz.free.fr/iotop) and confirmed that SWAPIN remains at 0% with this fix. Without the fix, SWAPIN was a constant 35-95% for _each_ Resque worker subprocess. The parent process did not swap out, which indicated an issue with the code in the `Kernel.fork` block.

![swap](https://f.cloud.github.com/assets/832655/268181/5d70978e-8f11-11e2-93f4-c67b74886b71.png)

I am not sure why any issues here were not caught by `Process.waitpid`, so if someone has an idea I'd love to know.