Ruby Backend Performance Getting Started Guide

You want a faster app - where should you start? At RailsConf 2017 I was in a panel “Performance: performance” moderated by Sam Saffron and joined by Eileen Uchitelle, Rafael Franca, and Nate Berkopec. While we talked about many things, I realized I’ve never written explicitly about how to go from “zero” to “working on application performance”. Here’s the video from the panel if you’re interested:

Keep Reading


Stopping the Death Spiral of Indecision

Break things and move fast. Which things? How fast? What if we’re stuck? A death spiral of indecision is when there’s a problem everyone agrees that must be solved - But there’s not one clear obvious winning answer. Today, I want to share an extremely effective technique I’ve used to make progress in these hairy situations.

Keep Reading


The Fastest Way to Generate a Heap Dump on Heroku

You’ve got an app with runaway memory use, what do you do hotshot? What do you do? If you’ve exausted the usual suspects it might be time to take drastic steps. It might be time to take a production heap dump. I previously wrote about doing this on Heroku, but since then we’ve launched Heroku exec, a way to SSH into a live running Dyno to allow you to debug. Now that you can do that, you don’t need an AWS account or any fancy gems to generate a heap dump, just activate this feature and add the rbtrace gem to your app. Let’s do this to an app together.

Keep Reading


A Variable By any Other Name

Sometimes when you do everything right, things still go wrong. I previously talked about how bad I am at spelling and grammar in “The Four Year Typo”, which reminded me of my first major production failure at Heroku.

Keep Reading


The Four Year Typo

I’m a horrible speller. I often joke that I got into programming because it doesn’t matter how you spell your variables, as long as you spell them consistently. Even so, I spend a good portion of my days writing: writing docs, writing emails, writing commit messages, writing issue comments, and of course writing blogs. Before I publish an article, I run my work by an editor, which makes this typo even more exceptional.

Keep Reading


Jumping Off The Ruby Memory Cliff

The memory use of a healthy app is like the heartbeat of a patient - regular and predictable. You should see a slow steady climb that eventually plateaus, hopefully before you hit the RAM limit on your server:

Keep Reading


Double Ruby Rainbow Bug

What happens when “don’t do that” turns into “it worked before”? This is exactly the scenario I was faced with recently. We had a string of tickets in under two days with the same weird error message. This frequency normally indicates that something changed, but the error was in a weird place, didn’t seem to be related to any new code. Here’s the error people were reporting on Heroku:

Keep Reading


N+1 Queries or Memory Problems: Why not Solve Both?

This post is going to help save you money if you’re running a Rails server. It starts like this: you write an app. Let’s say you’re building the next hyper-targeted blogging platform for medium length posts. When you login, you see a paginated list of all of the articles you’ve written. You have a Post model and maybe for to do tags, you have a Tag model, and for comments, you have a Comment model. You write your view so that it renders the posts:

Keep Reading


Config: Behavior versus Credentials

An application doesn’t have one type of configuration, it has two. In Rails, it’s confusing since we muddle these two together under a giant switch statement powered by RAILS_ENV. Let’s start with some definitions.

Keep Reading


Puma, Ports, and Polish

Polish is what distinguishes good software from great software. When you use an app or code that clearly cares about the edge cases and how all the pieces work together, it feels right. Unfortunately, this is the part of the software that most often gets overlooked, in favor of more features or more time on another project. Recently, I had the opportunity to work on an integration between Rails and Puma and I wanted to share that experience in the context of polish and what it takes to make open source work.

Keep Reading


Support my writing, Join my Mailing list 😻

You'll get an email when I write new posts. It costs you nothing, but lets me know you like what I wrote and want more. Enter your email below.