Photography: Sigma’s 200-500mm f/2.8 lens

Thanks to Rusty for pointing out a lens that, apparently, made its debut more than two years ago, yet went entirely unnoticed by me. The Sigma 200-500mm f/2.8 lens.

f/2.8 means that this lens lets in a lot of light, allowing you to shoot in dimmer light or to get really high shutter speeds for freezing motion in sports. You rarely see zoom good lenses above 200mm, much less with an f/2.8 aperture. But Sigma has done it, and it goes all the way to 500mm. (Bonus: they include a 2x tele-extender, allowing the lens to serve as a 400-1000mm f/5.6 lens.) 500mm is a pretty long telephoto.

There’s a problem with crossing a really long lens with a really wide lens, though. The fact that it’s $22,000 worth of glass is one of them. The other is that it’s ludicrously large.

The Italian JuzaPhoto has a review of the lens, the only site I’ve found that far that actually used the lens prior to reviewing it. There are a lot of 100% crops from what appear to be Arab postage stamps, with a link to some real shots with the lens. The shots are quite remarkable, though I find it odd that there are maybe 8 photos in the world known to be taken with this lens.

But one pressing question remains: why, Sigma, would you make the lens green?

If I Made Computers

I think you could say with relative accuracy that there are three main bottlenecks in a computer: CPU, memory, and disk. There are some outliers that people might try to pile in: video card performance, or network throughput if you’re tweaking interrupts on your 10GigE card. But the basic three are pretty universal.

To cut to the chase: I hit disk bottlenecks sometimes, CPU bottlenecks almost never, and RAM bottlenecks all the time. And sometimes high load that looks to be on the CPU is really just I/O wait cycles. But RAM is special: if you have enough RAM, disk throughput becomes less important. At least, redundant disk I/O, which seems to account for a lot of it.

What interests me, though, is that almost everything is RAM starved in my opinion. My laptop has 2GB and I get near the limit fairly often. I’m thinking of trying to take it to 4GB. The jury’s out on whether or not it’ll see more than 3GB, and others complain that 3GB causes you to lose out a bit on speed.

But here’s the thing. I maintain things like a MySQL server with 32GB RAM. It’s not RAM-bound per se: we could switch to a machine with 1GB RAM and MySQL would still run fine. The memory is overwhelmingly configured for various forms of cache. But it’s not enough: there’s still a steady stream of disk activity, and a non-negligible number of queries that have to write temporary tables to disk.

RAM is cheap. It’d cost me about $50 to buy 4GB of RAM for my laptop. The reason RAM stops being cheap is that most motherboards don’t give you enough room. Both of my laptops can only take two DIMMS, which means I need dual 2GB sticks. They’re both based on older 32-bit chipsets, so I can’t exceed 4GB, but if I wanted to, I’d need dual 4GB sticks, and those are expensive. Even on decent servers, it’s hard to find many that give you more than 8 slots, making 32GB hard to exceed.

So what I’d really like to see someone bring to market is a 1U box with as many memory slots as it’s physically possible to fit in. 1U is still tall enough to have standard DIMMs standing up, and most of them are extremely deep. I bet you could fit 256 slots in. Then throw in a compact power supply, a standard LGA775 slot (allowing a quad-core chip), a good Gigabit NIC or four, and an optional FibreChannel card. No hard drives. Maybe a 4GB CompactFlash card if you really want it to have its own storage. Oh, and make sure the motherboard is pretty versatile in terms of RAM requirements and FSB. Oh, and don’t force me to go with ECC. If this were a single database server, it might be worth buying top-notch ECC RAM. But if this were just for caching things, I don’t care. Cache isn’t meant to be permanent, so an error is no big deal.

256 slots, and you could fill it with ultra-cheap 1GB DDR2 DIMMs. (Heck, at work, we have a bag of “useless” 1GB sticks that we pulled out.) You can get ’em for $10 a pop, meaning 256GB RAM would cost about $2,560. I suspect the system would command a high premium, but really, it’s just $2,560 worth of RAM and a $200 processor. A 2GB DIMM is about twice as much ($20/stick), but $5,000 for half a terabyte of RAM isn’t bad. Though 4GB DIMMs are still considerably more: they’re hard to find for under $100.

I think this would be a slam-dunk product. memcache is pretty popular, and it’s increasingly being used in previously unheard of roles, like a level 2 cache for MySQL. There are also a lot of machines that just need gobs of RAM, whether they’re database servers, virtual machine hosts, or application servers. And tell me a file server (sitting in front of a FibreChannel array) with 256GB RAM for caches and buffers wouldn’t be amazing.

So, someone, hurry up and make the thing. The key is to keep it fairly cheap. Cheaper than buying 4GB DIMMs, at least.

Cool MySQL Projects

I think part of the thing I love about MySQL is the same thing I love about Firefox and Thunderbird. Even though I sometimes wonder if there are databases that would work better than MySQL or have fewer bugs, MySQL has an incredibly rich community that’s home to myriad fascinating projects.

I’ve looked into MySQL Proxy at work a bit, and found it pretty interesting, but it’s still considered alpha-level code, and we don’t really need a proxy in front of our database right now.

I’m not even going to pretend that the links that follow are all things I’ve just found on my own. They’re inspired from this Xapbr post, with Xapbr being a blog run by one of the top guys at Percona, and Percona being a well-known MySQL consulting firm, perhaps best known for the O’Reilly High Performance MySQL book. (A must-read even for people who aren’t full-time DBAs!)

It turns out that MySQL Proxy has a competitor, Dormando’s Proxy for MySQL, better known as dpm. It’s a BSD-licensed proxy created by SixApart’s DBA. (SixApart used to own LiveJournal, which is well-known for releasing memcached to the community.) Given that I’ve worked with neither dpm nor MySQL Proxy, I’m not able to comment on the merits of either, but it’s a handy link to have.

I’m also interested in the Tungsten Replicator, an Open Source project providing (emphasis mine) “database-neutral master/slave replication,” which was interesting enough to keep me reading past the words “JDK” and “Ant,” which are technical terms meaning “bloat” and “memory leaks.” (I kid… Sort of.) It looks like the project is mostly MySQL-centric right now, but capable of replicating MySQL databases into Oracle. (But apparently not the other way, probably since Oracle binlogs aren’t as publicly-documented as MySQL’s.)

And then there’s WaffleGrid, a project using memcache as an L2 cache. That is, MySQL will first look in its own caches, but in the event of a cache miss, will check memcache before turning to disk. It looks like it gives stellar results, even though it’s one of those things that seems kind of wrong. (You’d think that, if you’re adding memory to better cache your database, you’d want to put it in the MySQL machine, and if you needed to scale to a cluster of memcache boxes, you might be better off spreading the load around several MySQL boxes… But at the same time, clustering isn’t something MySQL excels at right now.)

Drizzle is “a lightweight SQL database for [the] cloud and web,” which is forked from MySQL 6. (And for those of you scratching your heads: yes, I said version 6. Yes, 5.1 is the latest release branch.) There are some big names working on Drizzle, and besides “the cloud,” they talk a lot about “massive concurrency,” which is something that should be of interest even to people running more traditional databases.

And, of course, there’s Percona’s XtraDB engine for MySQL, a significant overhaul to InnoDB. It seems a bit of a young technology for production environments, and yet it seems like it’s production environments where it would have the best impact.

This is only tangentially related to MySQL, but I’ve seen Sphinx mentioned in at least three distinct places today, a SQL-based fulltext search index. I’d be curious in seeing how it compares with Lucene.

Damages, Season II

Although you probably shouldn’t take your reviews from someone who watches very little TV, the first season of Damages was absolutely, positively the best show to ever air on television. Besides being a thrilling show to watch, it was brilliantly produced. One of the lead character’s mottos was “Trust no one,” which can easily be adapted to what should be the show’s motto: Trust nothing.

Season 2 finished this week. From the very first episode I was uneasy. While the first season left lots of loose ends, it was a hard act to follow. A second season was bound to be like Mona Lisa II: even if it were done with the utmost of skill, it’s following something that’s difficult to top. And that’s mostly how I still feel about Season 2: a great TV series, but really not on par with the first.

But I disliked Season II for some other reasons. For one, it was a largely different cast of characters, and it took me a long time to figure out who was who. And I really didn’t care for Ellen in the second season: perhaps she was just burned out from all that happened in the first season, but I found her personality thoroughly unlikeable.

While Season 1 had a thrilling aspect where the characters you liked suddenly turned out to be evil and vice versa, Season II sometimes took this to ridiculous extremes. It almost became predictable: if you liked a character, they were bound to be bad, and if you disliked a character, they were bound to be good. The show’s affinity for playing with time by abruptly shifting to “5 Months Later” or “3 Months Earlier” also grew tiresome at times, too. Since very early on in the second season, every episode would feature a flash-forward to a scene that was explained in the final 15 minutes of the season. I won’t give anything away, other than to say that I found what actually transpired to be lame and implausible. I’d use that same expression to describe a few other events that occurred.

Overall, I’d give the show a solid “B.” It’s still a great show, but Season 1 was a tough act to follow, and I had a persistent feeling that Season 2 wasn’t up to those standards. If you haven’t seen Season 1, don’t watch Season 2: the show should really be experienced in chronological order. To the question of whether Season 1 fans should watch Season 2, my conclusion is “Meh.” It’s not a bad show, and it has great parts, but it won’t live up the standards that Season 1 set.

Delete Old Files in Linux

Here’s a good one to have in your bag of tricks: all the time I wind up with a directory where I just want to delete anything older than a certain number of days. Here’s a pretty simple one:


DELETE_PATH='/var/backup/full_dumps/'
DAYS_TO_KEEP='7'

for i in `find $DELETE_PATH -ctime +$DAYS_TO_KEEP`; do
ls -lh "$i"
#rm -vf "$i"
done

The delete is commented out, so it will just list the files. Uncomment when you’re convinced it does what you want. Obviously, change the top two lines to suit your needs, and play around with find (for example, there’s an atime instead of my ctime). But it’s a handy little thing to have around and just adapt as needed.

bash: Looping over a range

This falls into the category of things that are simple yet I’m always trying to remember. Sometimes in bash I find myself wanting a for loop, not of the usual foreach type (for i in `ls /etc/`; do ...), but a more classical one (a la C-style for var=0; var<100; var++ ... syntax). Here’s the bash way:


for i in {0..99}; do
echo $i
done

The output is a list of numbers from 0 to 99. For a fun example of when you might need this, consider the case of noticing that Postfix isn’t running on a machine and starting it. Your mail client promptly crashes, and the flurry of output in the log indicates that it’s delivering mail as fast as it can, but complaining that some mail has been in the queue for 180 days. “Holy smokes,” you exclaim, stopping Postfix. “Just how much mail is there?” You’re not entirely sure because you aborted your ls after it sat for a good minute with no output. That’s never good. du -sh shows about a gig and a half.

“I’ve got this under control,” you think. rm -f /var/spool/postfix/*. Ta-da! Wait, what’s this “/bin/rm: Argument list too long” business? That error can’t possibly be good. rm very rarely complains. So we tried a smaller delete size, thinking we could do postfix/1*, postfix/2*, etc. Just step through it. That, too, was too much for rm.

So it ended up taking an absurd for i in {0..99}; do rm -f /var/spool/postfix/$i; done to purge the mail. (And that didn’t catch all of it, either; I’m not sure off-hand how to do this in hex.) Each iteration deleted somewhere around 2,000 mail messages, making me think there were something like a half-million messages. (00-FF, times a little under 2,000.)

Transgender Rights

As the gay marriage debate broils, I’ve been hearing about transgender rights a bit lately. As someone who hasn’t sat down and read a newspaper lately, I was a bit out of the loop. I’d seen it mentioned in passing in a few times, and then one morning there was nothing good on FM radio on my drive into work, so I switched over to AM.

It turns out, by the way, that the AM band is the (almost) exclusive province of conservative talk radio. So I found one radio station that talked about the absurdity of the transgender rights bill, known by some in New Hampshire as the “bathroom bill.” It seems that the bill is to allow transgendered people to use whatever bathroom they like, regardless of whether it’s labeled as Male or Female. That seemed like a pretty ridiculous law to me. The talk radio hosts went on to describe a situation in which your young daughter would be in a public restroom, and then a giant gay man/pedophile would go in after her and you’d be powerless to object, since he’d claim he was transgendered.

But it turns out that you shouldn’t get your news from random far-right talk radio shows on AM radio. I saw another reference to “The Bathroom Bill” in New Hampshire, so I actually looked into it.

First of all, here’s the Transgender Wikipedia page. I think many people (including myself) thought it referred to people who had operations to change their gender. In actuality, it refers to people who were born one gender but but are mentally a different gender, or those “whose identity does not conform unambiguously to conventional notions of male or female roles, but combines or moves between these.”

More significantly, “The Bathroom Bill” is a giant misnomer. The law does little more than plunk “transgendered person” into the middle of the equal rights bill. It makes no mention of bathrooms at all.

But in viewing a discussion of other things right now, someone pointed out a few good points:

  • No one seems to be able to find any law governing bathroom usage now. I don’t believe it’s illegal for a male to go into the lady’s room, or vice versa. Sure, in most cases it wouldn’t go over well, but now imagine a mother going to check on her young son in the men’s room. It’s already legal.
  • You don’t have to prove your gender to use a bathroom or locker room.
  • With status quo (the law not proscribing which bathroom should be used), no one seems to be aware of a single case of a transgendered person causing problems by using the “wrong” bathroom. More directly, no one seems to be aware of a transgendered person ever using the “wrong” bathroom, because it’s a total non-issue.
  • Transgendered people aren’t looking for bathroom equality. The bill has nothing to do with that. They’re looking for protection against people who fire them or otherwise egregiously discriminate against them.

So I didn’t care before. But now I do. Even though I don’t think I’ve ever met anyone transgendered, I’m supporting transgendered rights. I thank the uberconservative talk radio show I happened across for distorting the issues enough to get me interested in the issue.

Politics

Lately I’ve felt that things were going pretty well. I was reading a bit of international news and looking at the international reaction to our presence at the G20 summit, for example. Of course not everyone in the world loves us, but I couldn’t help but feel that our presence was a little different than last time. Our President helped get disagreeing parties to agree, and in general seems to have the world eager to work with us. (I don’t really mean this as a condemnation of Bush, nor is it my intention to heap praise on Obama.)

And then I read what conservatives are saying, and it almost seems like we’re looking at two vastly divergent realities. I see a statesman, they see a closet Muslim who was all too eager to bow to an Arab leader and who went out of his way to apologize for being American. I see a fiscal plan inspired by John Maynard Keynes, they see someone deliberately wasting money for his own gain. I see the first black President, they see the first illegal immigrant President. I see a President who came in after Bush’s first round of financial bailouts and pretty much continued the policy, they see a President who nationalized the banks because he’s a Socialist. Oh, and he wants to take everyone’s guns away, and destroy Christianity.

I’d gone a while without reading the “wingnut propaganda,” and in that time period, I’d come to think that things were pretty good. Obama’s approval rating is something like 70%, and the two parties have been known to work with each other a bit lately, even if it’s been far less than I’d like. (And even if it’s been largely Democrat-led, which doesn’t really make for impressive bipartisanship…) And then I realized that there’s a lunatic fringe that seriously believes he’s a Muslim or a Socialist, and became truly worried. Fiscal conservatives and social conservatives may dislike Obama, and I respect their different views. Divergent views, discussed and brought to compromise, truly leave us better off. But there are thousands, if not millions, of Americans who have literally lost touch with reality. They’re like the MIHOPs of the Democrats.

I also want to caution that when I use terms like “neocon” and “wingnut,” I mean them more literally, not as terms to refer to all Republicans. Similarly, I respect Republicans and hate the artifically-created divide between the parties. What I’m complaining about is the wingnut Republicans who use utter lies to advance their own causes. There are Democrats who do the same, surely, but with Democrats leading Congress and the White House, those people aren’t noteworthy right now.

Anyway, two things have interested me lately. Besides the thousands of dead Americans, one thing that always bothered me about the Iraq War was the exorbitant cost. If the money were spent domestically, it could have gone an amazing distance. The military takes up something like 50% of our spending. So I’m waiting to see what the wing-nut faction of Republicans says. They’ve spent weeks protesting Obama’s Socialist spending. But the Democrats have long complained that the Iraq War is too expensive, and Republicans have argued that not giving the military a blank check amounts of waving the white flag of surrender. So I’m curious where this will go, because it could leave Republicans in an awkward state either way. Hopefully it will just be passed and nasty politics will be left out of it.

But then I was reading this article about how Obama may be looking to get the ball rolling on immigration reform. And the general description of his plan seems to amount to increasing border patrol and cracking down on illegal immigration. During the campaign trail one of the things he discussed was a path to citizenship, but with a pretty steep burden: you’d have to learn English, pay back taxes for as long as you’ve been in the country, pay a fine, and only then would you “get in line, behind everyone who came here legally” to become a citizen. Of course, that was something discussed during the campaign trail. The “official” Administration hasn’t even released a plan yet, but has merely made mention of strengthening border control, and the article is little more than speculation.

Yet some Republican activists have already denounced Obama’s (currently non-existent) plan as “dangerous” and “amnesty.” Seriously.

Promession

After experiencing XKCD’s problem with Wikipedia first-hand, I went from the page on canned air to the page on liquid nitrogen to the page on promession. “What is promession,” you might wonder?

It’s a new alternative to cremation, in which a corpse is frozen with liquid nitrogen until it is so brittle that it can be shattered sufficiently to render it nothing more than a pile of extremely cold dust. It’s then returned to room temperature, allowing all the water in the body to evaporate. (Metals are apparently removed from the body at this point, too.) This dried-out smashed-up body powder is then buried, much like in cremation, only there’s more dust than with cremation. The good news is that it’s eco-friendly.

Prediction: promession is not going to catch on very quickly.