Jamie's Weblog

Procrastination and utter drivel since 2001!
  • Email
  • Github
  • Linkedin
  • Twitter
  • Rss
  • Home
  • About
  • Archives
  • Publications
Home» Ruby on Rails » Speeding up Rails development

Speeding up Rails development

Posted on September 1, 2012 by Jamie Lawrence in Ruby on Rails, Tips & Tricks

A brand new Rails app is a joy to work on but over the past few weeks I’ve noticed the app getting slower in development as, in hindsight, I added more and more stylesheets and javascripts. The culprit, I quickly realised, was the asset pipeline. On each page refresh it was reloading all the assets, compiling the .less and coffeescript files etc. And since I was using nginx with a 30sec timeout, the page refreshes would often fail and the workers would hit 100% CPU usgae. I got around this by pre-compiling the assets (as you’d do in production) but this week I got majorly bitten by these old pre-compiled assets taking priority over the master assets. So, I was back to 30sec page requests in development. Not fun.

I did a little googling and the rails-dev-tweaks gem came up. In short, it’s a lifesaver. It only reloads assets that have changed and it’s so far been spot-on about refreshing new files but still serving the pages in fractions of a second. I’m sure there are some gotchas but it’s a huge productivity boost

In short: using Rails 3? Install rails-dev-tweaks

asset pipeline, nginx, rails No Comments

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Contact Me

  • jamie@ideasasylum.com
  • ideasasylum
    • Twitter

Categories

  • BalanceTrackr (2)
  • C# (1)
  • dualpricing.ie (2)
  • hack (1)
  • Java (4)
  • Linux (3)
  • Measure it to change it (2)
  • Parenting (2)
  • Personal (36)
  • Photography (13)
  • Projects (7)
  • Python (3)
  • rant (20)
  • Reviews (20)
  • Ruby on Rails (18)
  • Taskmonifier (1)
  • Tech (1)
  • Tips & Tricks (7)
  • tuesdaypush (1)
  • Uncategorized (877)
  • Useful (3)
  • Weekly Picks (5)
  • Work (2)

Tags

accident backups barcampcork batteries bizcamp business car copyright depression dual pricing eneloop fowadublin fun gallstones git svn health ipad iphone lens life motivation nginx Personal phd photographers photography photos pinterest podcasts prism quote rails rant renault scenic review rspec ruby sew shutterscouts ssl startups swimming vagrant windows wrap

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

(c) 2012 Jamie's Weblog