Danny Burkes's blog



Danny BurkesDanny Burkes
Standup 5/27/2010
edit Posted by Danny Burkes on Thursday May 27, 2010 at 12:52PM

Ask for Help

Recurring jobs

A pivot asked "what is the current state of the art in scheduling recurring processes?"

The first-order answer was simply "cron", but then the conversation got interesting.

Cron has a few downsides-

  • Each task execution has to re-load the entire ruby/rails runtime, so, you pay a significant penalty in terms of startup time
  • Crontabs often don't get checked into source control, so there ends up being little visibility into which jobs are running when

One suggestion to solve the visibility problem was to use the whatever gem, which allows you to express your cron schedules in a ruby DSL that can easily be kept in source control.

A suggested alternative that eliminates cron altogether is resque-scheduler with resque.

The upsides with resque-based scheduling are that all your schedule logic is expressed in ruby, and you don't pay the ruby/rails startup penalty for each worker.

The downside is that it adds additional operational infrastructure for you to manage (the resque workers and the redis server(s)).

Danny BurkesDanny Burkes
Standup 5/25/2010
edit Posted by Danny Burkes on Tuesday May 25, 2010 at 12:46PM

Interesting Things

  • Rails 2.3.8 is out, fixing HAML compatibility and no longer inadvertently requiring rails_xss.

  • RailsBridge Open Workshop Project is hosting Mighty Ruby Tuesday tonight in San Francisco. RailsBridge puts on workshops around San Francisco (and last week, in New York) that give women a safe place to learn programming, or if they're already programmers, learn Ruby. Pivotal is a sponsor and we support this important effort to bring gender parity to the Rails community.

Danny BurkesDanny Burkes
Standup 5/24/2010
edit Posted by Danny Burkes on Monday May 24, 2010 at 03:40PM

Ask for Help

Identify and uploaded files

Running identify on uploaded files sometimes fails, because by the time identify gets hold of the file, the file extension has been lost (it has been written to /tmp or the like).

The suggested workaround was to see if the filename specified in the Content-Disposition header, if present, could be carried through to the temporary file.

Interesting Things

  • Amazon has recently introduced a reduced-durabilty pricing tier for S3 storage, with significant discounts available to those who can live with 4 9's versus 11 9's of reliability. This seems like a win for things like thumbnails, which can easily be re-created from the originals on the off chance that they were actually lost by S3.

  • Rails 2.3.7 is out, but it doesn't play nice with HAML just yet. Projects using HAML should avoid upgrading until those incompatibilities are ironed out.