Firefighting an RSS Aggregator’s Performance
That’s a before-and-after shot of the database server’s CPU! I was watching it slowly creep up, planning to inspect it after some other work, before receiving mails from Linode that the virtual server...
View ArticleRails Cache Sweeper Gotchas
As you’ll see here, Rails cache sweepers are a tricky subject. Here are some general things I’ve learned. Sweepers are dual creatures. “Here’s the scoop: sweepers observe both your models and your...
View ArticlePrivate resources with ElasticSearch and Tire
I’m adding private channels to Player FM and one consideration is search results. Tire’s activerecord does a great job at making updates transparent, but in this case some manual overriding is...
View ArticleMonkey-patching a sample() method in Rails
It’s useful while debugging to choose a random sample. Thus you can include something like this in application.rb or an initializer. Now you can say Post.sample to get a single post or Post.sample(5)...
View ArticleTesting HTTPS Locally
As I’m migrating the player over to HTTPS, one challenge is partial content, leading to an incomplete padlock and strikethrough domain warning like this: And the harsh but fair warning, upon...
View ArticleDefer and Recur with Rails, Redis, and Resque
I’ve put off some scaling related issues about as long as possible, and am now proceeding to introduce a deferred-job stack. I’ll explain what I’ve learned so far, and with the caveat: this isn’t in...
View ArticleLogging an error with Exceptional
Here’s a quick utility for people using Exceptional to track errors. It lets you force an exception to be logged and without having to rescue it. Example: exceptional “read_file”, “file not found” The...
View ArticleLoad-balancing Rails with Nginx
Well this was some fine undocumented black magic. I’ve got Player FM behind a load balancer now, using the following Nginx config. I’ll explain some more about the overall upgrade later. # App load...
View ArticleHow to use different favicons for development, staging, and production
It’s useful to have different favicons for each environment during development, as Pamela recently pointed out. Here’s how I do it. First, generate the images. Most graphics editor have some kind of...
View ArticleSpeeding up Rails tests with Spring
I found Rails tests were running slow, these things helped. Instrumenting application.rb First, I added some logging to application.rb ruby < view plain text > def logg(m) puts "#{DateTime.now}...
View Article
More Pages to Explore .....