I’m pretty sure there’s no air raid going on.
Plastic Bags Considered Arty
![]() |
The Floor |
What is that lovely expressionistic piece of art on the right, you say?
Let me tell you a story.
I went shopping for groceries at ICA today. I left the bags on the floor in the kitchen.
The kitchen floor has heating cables. The cables switched themselves on.
The red text on the plastic bags melted.
![]() |
The Bag |
No, the the floor does not get toasty warm. It just gets pleasantly warm. But obviously ICA is using plastic that melts at very low temperatures.
I should sow them for a million megabucks!
Or I could just get the floor repainted, which I was kinda planning on doing, anyway…
(The picture on the top right was taken after scrubbing at the redness with White Spirit for ten minutes. It didn’t help much.)
So much drama!
Compositing Text Over Images
![]() |
8 Inch USB Screen With Composited Text |
I have a number of small USB-powered screens scattered across the apartment that displays various stuff that I find myself wanting to know. In particular, I always want to know what music is playing. And I sometimes want to know what temperature it is outside. (And I can tap the screens to pause the music.)
So I want to display the sleeve of the currently playing album, and I want to display the group/album/track name. And on the screen in the “office”, I want to display the temperature in the room and the temperature outside. Because I want to know how many layers of wool I have to put on before going outside.
“This should be easy enough to script up with ImageMagick”, you’re probably thinking. But I want the font be Futura, and I want the text to have a “shadow” around it so that it can be read no matter what the background (i.e. the sleeve) looks like.
My go-to tool for all text-based things is LaTeX. (Yes, I know.) And after fiddling around a bit with LaTex and netpbm, I got the look I wanted. (“A bit” is a euphemism for “a few minutes every day for a couple of weeks until it didn’t look hideous”. (And “a few” is a euphemism for “a lot of”.))
![]() |
This Is A Button |
The solution I settled on was to take the output from LaTeX, convert it into pnm, and then blur the outlines for a number of times. Then I used this blurred image as the alpha channel on a black image. By then compositing all these images over each other (the background image first, then the black image with the alpha channel giving the outlines of the text, and then the text itself on the top), I got the result you can see on the image at the top.
Probably not usable for anybody else as is, but I’ve put the scripts up on GitHub anyway. Somebody out there may want to do something similar some day, and perhaps this will help in some way.
And publishing code like this always helps. It’s been through so many iterations that the code was just a total nightmare, and cleaning it up (as one does) before publication makes the code more maintainable for my personal use, too.
March 9th, 2012
I’ve switched the SSD disks back to the LSI MegaRAID SAS 9260-8i controller again, and did some final benchmarks.
I’m comparing reading bits of the Gmane spool in semi-random (i.e. ext4 directory) order, name order (which is also the same order as the files were created), and finally, just reading a big hunking file. I’ve done this on a spinning disk, with soft RAID, and with the MegaRAID. The last two are over five Samsung 830 512GB in RAID5 mode.
Semi-random order | Name order | Sequential reads | |||
---|---|---|---|---|---|
Spinning disk | 234 files/s | 2 MB/s | 6062 files/s | 48 MB/s | 130 MB/s |
Soft RAID5 over SSDs | 4076 files/s | 32 MB/s | 8103 files/s | 64 MB/s | 264 MB/s |
LSI MegaRAID SAS 9260-8i over SSDs | 4564 files/s | 36 MB/s | 18708 files/s | 148 MB/s | 580 MB/s |
So, for the thing that matters — semi-random reads — we get a 20x improvement going from spinning magnetic disks to SSD. However, the difference between using soft RAID over SATA2.0 versus using that spiffy MegaRAID SATA3.0 card isn’t very thrilling in my realistic use case.
However, being able to read the 19K files per second when I’m doing, say, re-indexing or statistical analysis, will certainly be nice. I’ll probably not get that speed when the machine is under load and serving out messages at the same time, but it’ll be a lot better than a contested spinning disk.
So to conclude: The LSI MegaRAID 9260-8i was a waste of time and money. I should just have soft RAID-ed the thing, as was my original plan. But since I’ve got the card now, I might as well just use it.
I’ve now started the real syncing of the entire spool to the new machine. That’ll probably take a few days, but I’m aiming for replacing the Gmane news server with the new machine sometime next week. This will hopefully mean the end of all those “load over 16” login denials.
And, Diary, since it seems that some people are able to hack into you and read my most secret thoughts, I’m going to go back to writing you with a quill pen on parchment again. Surely Google won’t be able to access you there.
March 7th, 2012
![]() | |
Brace yourselves.Winter is coming back |
Dear Diary,
I’ve now found some time to do further speed testing of the SSD machine that’s going to replace the Gmane news server. I know that you remember everything, Diary, but let me give you a brief recap.
I got a bunch of 512GB Samsung 830 SATA3 SSDs that are supposed to have IOPSes coming out of their ears. I got a RAID card, hooked it up, and was somewhat underwhelmed by the performance. I got a read performance of 4400 files per second when reading in kinda-random order, despite the RAID card having SATA3 and a special “key” that was supposed to disable the built-in slowdowns. That’s ok, but not extremely impressive.
So today I hooked the SSDs up the the motherboard directly. Unfortunately the motherboard only has SATA2, so the theoretical single-disk bandwidth is about 270MB/s. Pitiful.
And, wouldn’t you know it, large-file performance towards a single disk was 250MB/s when writing, and 265MB/s when reading. For small files, I get 4000 files per seconds, and 32MB/s.
So pretty much as expected.
Then I created a soft RAID5 over the disks. Large-file performance is 520MB/s, which is less than half of what I got on the SATA3 RAID card. The small file performance is 4200 files per second, which is just vaguely south of what that supposedly spiffy RAID card gave me.
This is all rather disappointing.
Diary, I’ll try once more with the RAID card, mixing up the RAID parameters, but I have little hope that much will change. I’ll have to settle for 4K/s performance when serving out messages from news.gmane.org, I think.