Archive for the ‘GNU/Linux’ Category
How to find per-process I/O statistics on Linux
Newer Linux kernels have per-process I/O accounting and you can use the iotop tool to find out what’s performing I/O, but in many cases I’m trying to find the source of an I/O problem in an older kernel. I found sort of a hack-ish way to do that today, while trying to figure out why a system was basically unresponsive.
I found a post on Stack Overflow that showed a way you can get per process I/O statistics from the kernel even in older kernels. I adapted this to my needs, and wrote a little script.
Here’s how you use it. First, get it:
wget http://aspersa.googlecode.com/svn/trunk/iodump
Then turn on kernel messages about I/O:
echo 1 > /proc/sys/vm/block_dump
This makes the kernel start writing messages about every I/O operation that takes place. Now all you have to do is get those messages and feed them into my script:
while true; do sleep 1; dmesg -c; done | perl iodump
Wait a little while, then cancel the script. The results should look something like the following:
root@kanga:~# while true; do sleep 1; dmesg -c; done | perl iodump ^C# Caught SIGINT. TASK PID TOTAL READ WRITE DIRTY DEVICES firefox 4450 4538 251 4287 0 sda4, sda3 kjournald 2100 551 0 551 0 sda4 firefox 28452 185 185 0 0 sda4 kjournald 782 59 0 59 0 sda3 pdflush 31 30 0 30 0 sda4, sda3 syslogd 2485 2 0 2 0 sda3 firefox 28414 2 2 0 0 sda4, sda3 firefox 28413 1 1 0 0 sda4 firefox 28410 1 1 0 0 sda4 firefox 28307 1 1 0 0 sda4 firefox 28451 1 1 0 0 sda4
I deliberately generated a bunch of I/O by deleting my Firefox history and cache.
Got any better ideas, warnings, etc? Post them in the comments.
Wikipedia’s concensus: Linux is an operating system
My brother sent me these thoughts, slightly edited:
Recently I looked at the [Wikipedia] Linux page. To my surprise it’s not about the kernel Linux, it’s about the “OS”. I looked at discussion and it appears that by general consensus the term Linux applies to the unix like operating system, and so it is correct for Wikipedia to follow that consensus. So, instead of providing information, they are deliberately misleading folks… Often what the majority does is wrong because the majority of people are not the experts. By definition, the experts are a minority.
You’d expect a higher standard from Wikipedia, wouldn’t you? Wouldn’t you? Aw, come on, surely you don’t mean to imply that Wikipedia is a place where things become true because most people say so, do you?
Consensus, when used in this way, is nothing other than mind-rot for the masses, group-think at its worst. There is a valid use of the word when it applies to decision-making. But this isn’t about decision-making, it’s about out-voting or out-discussing.
What’s interesting to me is that I heard a radio interview with Wikipedia’s founder Jimmy Wales, and he was extremely careful to say GNU/Linux when discussing the operating system that runs the website.
Saying that Linux is an operating system has not, does not, and never will make it true any more than saying that a steering wheel is a car makes it so.
How to make Thunderbird download new IMAP messages
One of the minor things I’ve noticed when I use Thunderbird on my IMAP accounts is that it doesn’t download IMAP messages until I click on them. Then I have to wait until I can see the message. I have heard that this is supposed to be fixed in Thunderbird 3, and I tried it but a lot of the extensions I need aren’t compatible with it.
Today I finally tried to search and find out more about the problem. Turns out I’m not alone — others have noticed that the setting to download message bodies for offline use doesn’t do what it’s supposed to.
Fortunately, there’s an extension for this. It’s called Sync On Arrival. So far, it’s working like a charm. The only thing I had to do was edit the install.rdf to increase the version number. It’s compatible with Thunderbird 2, even though it says it’s not.
Edit: see the comments for a way to do this with configuration alone, rather than an extension.


