March 11th, 2010
This may be obvious to everyone already, but it was new to me.
Serendeputy hits a few Tokyo Cabinets when it assembles a page. I was having trouble with these sometimes getting hung up, especially when looking up some of the ancillary information. I keep all the tag metadata in the main librarian cabinet. The site looks up this data pretty often. This would manifest itself on the site with a 500 error, and the Passenger Rails process would hang. The site would return 500s until I restarted the process. Ugh.
So, I did a couple of things (which I’ll likely talk about later.) The easiest one was probably the simplest.
I ended up adjusting the librarian build to not only populate the appropriate cabinet, but to also generate a ruby source code file in which I declared a constant with the tag metadata hash defined. I then restart Passenger to pick up the new constant.
Now, Rails only loads this once, and it’s in memory for the rest of the time. This not only saves me the network latency, it makes the individual responses much faster.
It’s always fun to solve complex problems with simple brute-force actions.
Posted in Programming, Ruby, Tokyo Cabinet | No Comments »
February 8th, 2010
Posted in Meta | No Comments »
January 29th, 2010
Posted in Serendeputy | No Comments »
November 19th, 2009
Posted in Meta, Serendeputy | No Comments »
November 9th, 2009
Posted in Serendeputy | No Comments »
August 27th, 2009
Posted in Linky Goodness | No Comments »
August 17th, 2009
Posted in Linky Goodness | No Comments »
August 14th, 2009
Posted in Linky Goodness | No Comments »
July 28th, 2009
Posted in Business | No Comments »
July 27th, 2009
Posted in Linky Goodness | No Comments »
July 15th, 2009
Posted in Serendeputy | No Comments »
July 3rd, 2009
Posted in Uncategorized, Meta | No Comments »
July 2nd, 2009
Posted in Meta | No Comments »
June 30th, 2009
Posted in Programming | 1 Comment »
June 25th, 2009
Posted in Web, Personalization | No Comments »
June 16th, 2009
Posted in Meta | 2 Comments »
June 16th, 2009
Posted in Serendeputy | No Comments »
May 29th, 2009
Posted in Programming, Emacs | No Comments »
May 26th, 2009
Posted in Serendeputy | No Comments »
May 26th, 2009
Posted in Serendeputy | No Comments »
May 4th, 2009
Posted in Business | 1 Comment »
April 29th, 2009
Posted in Linky Goodness | No Comments »
April 14th, 2009
Posted in Web, Programming, Ruby | 1 Comment »
January 28th, 2009
Posted in Web, Fan Mail, SEO | No Comments »
January 27th, 2009
Posted in Serendeputy | No Comments »
January 14th, 2009
Posted in Web | No Comments »
January 5th, 2009
Posted in Web, Serendeputy | No Comments »
December 12th, 2008
Posted in Web | No Comments »
November 19th, 2008
Posted in Serendeputy | No Comments »
October 22nd, 2008
Posted in Web | No Comments »
October 20th, 2008
Posted in Web | No Comments »
September 26th, 2008
Posted in Programming | No Comments »
September 16th, 2008
Posted in Programming, Ruby | 1 Comment »
September 16th, 2008
Posted in Web, Fan Mail, Ruby | 1 Comment »
September 15th, 2008
Posted in Serendeputy | 1 Comment »
September 10th, 2008
Posted in Programming, Ruby | 1 Comment »
September 5th, 2008
Posted in Programming | No Comments »
August 25th, 2008
Posted in Programming | No Comments »
August 11th, 2008
Posted in Web, Fan Mail | No Comments »
July 7th, 2008
Posted in Linky Goodness | No Comments »
July 1st, 2008
Posted in Linky Goodness | No Comments »
June 27th, 2008
Posted in Fan Mail | 2 Comments »
June 24th, 2008
Posted in Books | 1 Comment »
June 23rd, 2008
Posted in Linky Goodness | No Comments »