rc3.org

Strong opinions, weakly held

Month: February 2008 (page 1 of 4)

My misbehaving Rails application

My number one point of frustration with Ruby on Rails is that as easy it as it is to build Rails applications, it’s a big challenge to get them deployed properly (mainly due to lacking documentation for Capistrano) and to keep them running happily.

I have a simple Rails application that I’ve deployed using Apache and Mongrel, with three Mongrel processes. When I looked at top this morning (it had been running awhile), it was consuming over 500 megs of RAM. My first thought was, of course, “memory leak”. I restarted the app, and the ”mongrel_rails” process was consuming only 32 megs of RAM. I’ve since watched it grow to 45 megs of RAM consumed. That appears to confirm my suspicion that something is leaking memory.

What’s next? Finding the memory leak. The problem could be a bug in Ruby, Mongrel, the Ruby on Rails gems, any other gem I’m using, or my code itself. At this point I need to sift through the next steps and start experimenting. The options from here are:

  1. Start upgrading pieces of infrastructure for which new versions are available.
  2. Instrument the application and try to figure out what’s leaking memory.
  3. Try to reproduce the problem locally so that I can experiment in a safe environment.

I’ll let you know how it works out.

While I enjoyed developing this application using Ruby on Rails, the amount of infrastructure required to keep this relatively simple application up and running frustrates me a bit. Had I written this application in PHP, I might have two dozen files in a directory running under the versions of Apache and PHP that were bundled with the server’s Linux distribution. The odds of running into a memory leak in that kind of environment are really low, especially with an application as simple as the one I’m dealing with.

With Ruby on Rails and its relatively immature infrastructure, the administrative overhead is higher than it would be for many other types of applications. The complexity of the Ruby on Rails infrastructure also explains why Ruby on Rails is unsuitable for shared hosting.

The takeaway from this is that there’s more than speed of development to take into account if you’re deciding whether to use Ruby on Rails to build an application. You also need to determine whether you have the administrative cycles you need for the care and feeding of a Ruby on Rails application.

Update: The first thing I did was upgrade Rails from version 1.2.3 to 1.2.6. We’ll see what effect that has on the memory leak.

Hillary Clinton’s argument for stealing the nomination

Even if Hillary Clinton is losing in terms of the delegate count going into the convention, she doesn’t plan on losing the nomination. Her plan is to convince more superdelegates to vote for her than vote for Obama, and to make sure that the delegates from Florida and Michigan have their votes counted, even though those primaries were held under the assumption that those votes would not count. Unsurprisingly, she won both of those states, in fact, Barack Obama’s name wasn’t even on the ballot in Michigan.

Her campaign has created a new Web site, The Delegate Hub, that attempts to explain why voters should be perfectly OK with Hillary engineering a win at the convention.

Here’s the real message from the Clinton campaign: “Voters of Texas and Ohio, I really need your votes, but if I don’t get them, I’m going to try to figure out a way to subvert the process so that your votes don’t really count.”

Clay Shirky has written a great post explaining why this is a very bad idea. I hope he’s right. I’m posting about this because widespread exposure of Clinton’s machinations is the key to building a real backlash against them.

Yet another Obama economics article

Why is it that people keep publishing articles about the economic philosophy that underpins Barack Obama’s policy proposals without publishing similar articles about the other Presidential candidates? This time, Noam Scheiber writes about Obama’s economics. I find the pragmatism of a behavioral economics-based approach very appealing.

There’s a ton of good stuff in the article, but I’ll highlight a few paragraphs:

And, yet, it’s not just the details of Obama’s policies that suggest a behavioral approach. In some respects, the sensibility behind the behaviorist critique of economics is one shared by all the Obama wonks, whether they’re domestic policy nerds or grizzled foreign policy hands. Despite Obama’s reputation for grandiose rhetoric and utopian hope-mongering, the Obamanauts aren’t radicals–far from it. They’re pragmatists–people who, when an existing paradigm clashes with reality, opt to tweak that paradigm rather than replace it wholesale. As Thaler puts it, “Physics with friction is not as beautiful. But you need it to get rockets off the ground.” It might as well be the motto for Obama’s entire policy shop.

Like their intellectual godfather Thaler, the Obama wonks aren’t particularly interested in tearing down existing paradigms, just adjusting and extending them when they become outdated. (Thaler urges his students to master the same traditional, mathematical models their colleagues do if they want to be taken seriously.) For example, a central tenet of the economic thinking favored by Bill Clinton and his Treasury secretary, Robert Rubin, was that cutting the deficit lowers long-term interest rates, which in turn stimulates the economy. The Obamanauts are perfectly willing to accept the relationship between long-term rates and economic growth. But recent evidence suggests that low rates weren’t quite as central to the success of the Clinton years as they appeared, and that investments in infrastructure and R&D might be as important as deficit reduction. Not surprisingly, Obama plans to focus less on the deficit than Clinton did.

And yet, just because the Obamanauts are intellectually modest and relatively free of ideology, that doesn’t mean their policy goals lack ambition. In many cases, the opposite is true. Obama’s plan to reduce global warming involves an ambitious cap-and-trade arrangement that would lower carbon emissions 80 percent below 1990 levels by 2050. But cap-and-trade–in which the government limits the overall level of emissions and allows companies to buy and sell pollution permits–is itself a market-oriented approach. The companies most efficient at cutting emissions will sell permits to less efficient companies, achieving the desired reductions with minimal drag on the economy.

And here’s how that philosophy works in the realm of foreign policy:

Still, there’s probably no better illustration of the Obama camp’s Hamiltonian sensibility than the debate over the war. Former Clinton officials like Lake, Rice, and Danzig all opposed the idea from the get-go (as did Hamilton himself). In doing so, they faced down pleas from within the Democrats’ permanent State-Department-in-waiting that opposition would be politically disastrous. “Many Democrats had opposed [the first Gulf war]. And these people–particularly the older people, felt like that had been a big mistake. They didn’t want to make it twice,” recalls an Obama adviser. “It got rather acrimonious.”

In the face of these arguments, the would-be Obamanauts didn’t invoke some sweeping alternative paradigm–say, the kind of abstract theorizing you’d get from a Kissinger tome. They simply pointed out where the Bush doctrine of preemption and democracypromotion broke down–the “anomalies,” if you will. Intuition told them that an easy war was a fantasy, that the United States would face a long and brutal occupation. Many had security clearances during the Clinton administration and had never seen credible evidence of an Iraqi nuclear program. Almost everyone worried that an invasion would detract from the fight against Al Qaeda. “It should have been obvious to anyone who’d served in government that we can’t walk and chew gum at same time,” says one Obama adviser. “That’s not a paradigm, that’s a judgment.”

Lessig out

Larry Lessing has thought the better of his Congressional run and decided to drop out.

On Twitter and blogs

Alex King posts about lowering the noise on Twitter. He suggests that Twitter change “What are you doing?” to “Say something interesting,” which works for me.

The truth of Twitter is that it is many things to many people and the beauty of it is that you can mold the Twitter experience to your own tastes. If I want to follow people who treat Twitter like a shorter-form blog, I can, or if I want to follow coworkers who keep everyone abreast of what they’re working on up to the minute, I can do that as well. Ultimately we all get to decide who’s interesting to us, and limit our Twitter experience to only those people. As Russell Beattie points out, that’s a powerful thing.

The thing I like about Twitter is that it’s much more conversational. I don’t know who reads my blog unless they leave comments, and most people whose blogs I read probably don’t know that I do so. On Twitter there’s a reasonable expectation that people who are following you read your tweets, and that there’s a decent chance that someone you address directly will read your tweet as well. It seems like that relationship makes it much easier to build a community quickly, as you find among LiveJournal users or Vox users if you use those sites.

We had that type of community when there were many fewer blogs. Many moons ago, it seemed like basically everybody read everybody else’s blog. I could pretty much guess who would link to my posts as I made them. If I could come up with one innovation, it would be a way to ease building communities among bloggers running their own sites the way you can with Twitter and other sites where everyone is swimming in someone else’s pool.

The death of small magazines

Ed Ward laments the early demise of small magazines like No Depression, brought about in part by a restructuring of the postage rates for second class mail approved last year. Here’s how the new scheme works:

The new rates, though, were bizarre: the more magazines you shipped, the less each unit cost, and smaller-circulation magazines were burdened with unreasonably higher per-unit costs, instead of everyone paying the same rate. But that’s what happens when you allow big business to write the laws.

Economically that may make sense, but if preserving the diversity of the marketplace is important, then the new rate schedule is rotten. Here’s Ed on why small magazines matter:

Now, I think this is a tragedy from a number of aspects, and not just because of the loss of income and ability to write stuff which pleases me. As No Depression co-editor Grant Alden notes on his blog, “it’s important to provide homes for magazines which offer up ideas, for we need an informed democracy if we’re to continue having anything which resembles a democracy.” He’s talking about Wal-Mart’s decision to pare back the number of titles they sell, but the “homes” of which he speaks are also the homes of people who subscribe to magazines which espouse unpopular ideas or champion minority cultures, which both Resonance and No Depression did. It’s simplistic and obvious to say it, but if print media becomes reduced to People and Rolling Stone, then America is doomed to unspeakable mediocrity.

I know that as a guy who’s been blogging for nearly ten years now, I’m supposed to explain how the Internet is going to save us, but I still feel that something important has been lost.

The future of the exurbs

Over the past decade or two, it’s been impossible not to notice the trend of people moving back into cities from the suburbs, and more recently, the rise of engineered walkable neighborhoods in suburban centers that emulate some of the best qualities of city life. Call it urban renewal if you like, or gentrification if you’re less sanguine about it, the trend is real and it’s certainly coming to a city near you.

The big question has always been what happens to people of lesser means to whom the city centers were abandoned in the second half of the 20th century. Renters will be leaving as their landlords cash in by selling their land for redevelopment, and rising property taxes insure that homeowners in poorer neighborhoods don’t stick around.

In the current Atlantic Monthly, Christopher Leinberger argues that they’ll be moving to the suburbs, or more likely, the exurbs. Just as mass abandonment of the city for suburbs created a huge stock of cheap housing, the reverse migration of people back into the city will leave plenty of houses that are suddenly extremely affordable. Here are some numbers:

Arthur C. Nelson, director of the Metropolitan Institute at Virginia Tech, has looked carefully at trends in American demographics, construction, house prices, and consumer preferences. In 2006, using recent consumer research, housing supply data, and population growth rates, he modeled future demand for various types of housing. The results were bracing: Nelson forecasts a likely surplus of 22 million large-lot homes (houses built on a sixth of an acre or more) by 2025—that’s roughly 40 percent of the large-lot homes in existence today.

Those houses are going to be the cheap rental properties of the future.

There’s definitely a lot more going on in the US housing market than the subprime collapse.

Is local food production overrated?

In food as in everything, there are few simple answers. Everybody wants some heuristics to help them determine what’s good and in the food world, people look for terms like “organic” or “artisinal” or “local” and generally assume them to be shorthand for, “The person who produced this really cared about how it tastes.”

Heath at Wooly Pigs shoots down that kind of laziness with vigor. First, a little background. Wooly Pigs is a small farm in Washington state that is the only producer of Mangalitsa pigs in the United States. Mangalitsa pigs originate in Hungary, and are much closer in lineage to wild boars than any other domesticated pig. In other words, he’s exactly the kind of farmer who benefits from people with fat wallets looking for easy heuristics to help them pick which food to eat.

I’ve been fascinated by his blog since I first read about it, as it provides a hands on look at the trials and tribulations of a businessman trying to start a new business in a particularly risky industry. Plus, I really like pork, and his goal is to produce the best pork in the world. What’s not to like?

Anyway, he attacks the current local food fetish from a number of angles, including animal welfare, quality of product, and environmental impact. His argument isn’t that small producers are always better or distant producers are always better, but rather that there are no easy way to guess which food producers are really producing quality products in an environmentally sustainable way. Definitely worth reading if you care about what you eat. And if you don’t care about what you eat, there’s something wrong with you.

Update: Heath posted an update of the post I’m discussing, clarifying his thinking on the topic.

Comment preview

To satisfy the clamoring from some commenters, I’ve installed the Ajax Comment Preview plugin. No longer will you have to wonder how WordPress is going to mangle your comments, just click on the “Preview Comment” button to find out.

Microsoft Office XML

Back in December 2006, Andrew Shebanow commented on the difficulty of creating a converter for Microsoft’s Office 2007 document format, which uses XML after Bob Sutor of IBM called it a one-way format due to its complexity. Based on some numbers posted a Microsoft explaining why it would take longer to release a converter for the Mac version of Office, Shebanow came up with this estimate of the effort required to build such a converter:

It would take 5 developers a year to do a quarter of the work. That means the whole job is roughly 20 man-years of development time. That doesn’t include testing, documentation, or localization. That would probably double the number of man-years, at least. But it gets worse:

This is just for Word. We need additional teams for Excel and PowerPoint.

Back of the envelope, we’re now talking about 120 man-years. For Mac Office, Microsoft decided such an investment wasn’t practical, so instead they waited for Win32 Office to go final and are now porting the Win32 code to the Mac.

Today I read that Microsoft still hasn’t released the converter from Office 2007 to Mac Office 2004. It was scheduled for release in January, but has been pushed back to June.

Older posts

© 2024 rc3.org

Theme by Anders NorenUp ↑