The RightScale SQS gem returned an exception from SQS multiple times, including retries. Not an unusual event. This could have been caused by the SQS service being unavailable. However, the team noticed that despite the failure the message was actually successfully added to the queue and processed as normal.
ActiveSupport logger appears to open the default ruby logger and remove everything except the basic log message passed through. This is done for all subsequent uses of the logger. Perhaps this is done so that the log message could be passed to a syslog service which will add timestamps.
Whilst trying to parse differently formatted date strings from rss feeds a pivot found that date.now is overridden by DateJS to return a new date.
There was a suggestion, that later proved useful, to use google’s rss reader to first clean up the different rss feeds to ensure that they all can be parsed in much the same way.
Bundler 0.8.1 is out. There have been some significant changes around how the vendor directory is organized, so you’ll want to rm -rf vendor/gems and re-run bundle.
A team tried swapping in Sqlite to see if it made any difference in test suite runtime. It was actually slightly slower than MySql. In-memory Sqlite didn’t help either.
A gotcha when using cap and bundler:
“If deploy.rb does a require ‘auto_tagger’ and the auto_tagger gem is in the app’s bundle but not the system, running the system cap won’t find the auto_tagger gem. Using bin/cap runs the bundled cap and thus has access to all the gems in the bundle.”
A couple more items from last week:
Help: acts_as_soft_deletable doesn’t seem to work with STI. The plugin has been out for a while and it’s surprising that nobody has had a problem with this before now.
Q: What’s a good way to bulk insert a bunch of joined-up models? A: insert into a view. MySQL has updatable views now. This is also a great trick to use in Oracle.
net/http is slow. (and so are libraries that depend on it, like open-uri)
Performance Disclaimer: this ought to matter in your app, measurably, before you do anything about it. If you profile and ruby-prof is showing a bunch of classes like BufferedRead and Timeout at the top of the list, your app qualifies. And in addition if you know that your app is dependent on data transfer over http (let’s say you’re interacting with a Solr server, and you’re storing sizable documents in Solr), you should be aware of the problem.
Otherwise net/http or open-uri might be just fine for you.
The problems with net/http, and benchmarks of ruby http client lbraries are nicely written about in An analysis of Ruby 1.8.x HTTP client performance.
Some good alternatives:
Our findings matched the article referenced above – the alternatives have pros and cons but each was at least 10x faster than net/http for transfers of 50-300k response bodies.
The fastest solution we found was curb, reusing the Curl::Easy object:
curl = Curl::Easy.new
curl.url = "http://www.pivotaltracker.com"