The Basics of Signal Handling

Signals are one of the most basic ways programs can receive messages from the outside world. I’ve found limited tutorial-type documentation on them, so this post covers how to set them up and some debugging techniques. The easiest way to get a feel for signal handling is to play with a simple C program, likeContinue reading “The Basics of Signal Handling”

––thursday #5: diagnosing high readahead

Having readahead set too high can slow your database to a crawl. This post discusses why that is and how you can diagnose it. The #1 sign that readahead is too high is that MongoDB isn’t using as much RAM as it should be. If you’re running Mongo Monitoring Service (MMS), take a look atContinue reading “––thursday #5: diagnosing high readahead”

––thursday #4: blockdev

Disk IO is slow. You just won’t believe how vastly, hugely, mind-bogglingly slow it is. I mean, you may think your network is slow, but that’s just peanuts to disk IO. The image below helps visualize how slow (post continues below). (Originally found on Hacker News and inspired by Gustavo Duarte’s blog.) The kernel knowsContinue reading “––thursday #4: blockdev”

––thursday #2: diff ‘n patch

I’m trying something new: every Thursday I’ll do a short post on how to do something with the command line. I always seem to either create or apply patches in the wrong direction. It’s like stalagmites vs. stalactites, which I struggled with until I heard the nemonic: “Stalagmites might hang from the ceiling… but theyContinue reading “––thursday #2: diff ‘n patch”

––thursday #1: screen

I’m trying something new: every Thursday I’ll go over how to do something with the command line. Let me know what you think. If you are using a modern-ish browser, you probably use tabs to keep multiple things open at once: your email, your calendar, whatever you’re actually doing, etc. You can do the sameContinue reading “––thursday #1: screen”

Playing with Virtual Memory

When you run a process, it needs some memory to store things: its heap, its stack, and any libraries it’s using. Linux provides and cleans up memory for your process like an extremely conscientious butler. You can (and generally should) just let Linux do its thing, but it’s a good idea to understand the basicsContinue reading “Playing with Virtual Memory”

Installing Linux on a MacBook Air

It’s not a clean victory, but I got Linux onto my MacBook Air. When I first got my Air, I launched the Ubuntu install disk and followed the instructions on the Ubuntu wiki. Unfortunately, these instructions are apparently for the MacBook Air 1,1, and I had a MacBook Air 2,1. The Linux kernel froze inContinue reading “Installing Linux on a MacBook Air”