Richard Schneeman
Richard “Ruby Hero” Schneems writes Ruby at Heroku, maintains CodeTriage.com, and co-organizes Keep Ruby Weird. He is in the top 50 Rails contributors and is an accidental maintainer of Sprockets. He also wrote a few gems you might have heard of including Wicked, and derailed_benchmarks. Find more writing at https://schneems.com
- News
- Last Updated: May 30, 2024
- Richard Schneeman
I recently demonstrated how you can use Rack Mini Profiler to find and fix slow queries . It’s a valuable tool for well-trafficked pages, but sometimes the slowdown is happening on a page you don't visit often, or in a worker task that isn't visible via Rack Mini Profiler. How can you find and fix those slow queries?
Heroku has a feature called expensive queries that can help you out. It shows historical performance data about the queries running on your database: most time consuming, most frequently invoked, slowest execution time, and slowest I/O.
…
- News
- Last Updated: March 28, 2017
- Richard Schneeman
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:
<% @posts.each do |post| %>
<%= link_to(post, post.title) %>
<%= teaser_for(post) %>
…
- News
- Last Updated: June 03, 2024
- Richard Schneeman
Heroku bumped its Bundler version to 1.13.7 almost a month ago, and since then we've had a large number of support tickets opened, many a variant of the following:
Your Ruby version is <X>, but your Gemfile specified <Y>
I wanted to talk about why you might get this error while deploying to Heroku, and what you can do about it, along with some bonus features provided by the new Bundler version.
First off, why are you getting this error? On Heroku in our Ruby Version docs , we mention that you can use…
- News
- Last Updated: May 06, 2024
- Richard Schneeman
Rails 5 will be the easiest release ever to get running on Heroku. You can get it going in just five lines:
$ rails new myapp -d postgresql
$ cd myapp
$ git init . ; git add . ; git commit -m first
$ heroku create
$ git push heroku master
These five lines (and a view or two) are all you need to get a Rails 5 app working on Heroku — there are no special gems you need to install, or flags you must toggle. Let's take a peek under the hood, and explore the interfaces baked right into Rails…
- Engineering
- Last Updated: February 22, 2016
- Richard Schneeman
The asset pipeline is the slowest part of deploying a Rails app. How slow? On average, it's over 20x slower than installing dependencies via $ bundle install. Why so slow? In this article, we're going to take a look at some of the reasons the asset pipeline is slow and how we were able to get a 12x performance improvement on some apps with Sprockets version 3.3+ .
The Rails asset pipeline uses the sprockets library to take your raw assets such as javascript or Sass files and pre-build minified, compressed assets that are ready to be served…
- News
- Last Updated: March 28, 2024
- Richard Schneeman
Rails 5 has been brewing for more than a year. To take advantage of new features, and stay on the supported path, you'll need to upgrade. In this post, we'll look at the upgrade process for a production Rails app, codetriage.com . The codebase is open source so you can follow along . Special thanks to Prathamesh for his help with this blog post.
In Rails a beta means the API is not yet stable, and features will come and go. A Release Candidate (RC) means no new features; the…
- Engineering
- Last Updated: August 06, 2015
- Richard Schneeman
In a recent patch we improved Rails response time by >10% , our largest improvement to date. I'm going to show you how I did it, and introduce you to the tools I used, because.. who doesn’t want fast apps?
In addition to a speed increase, we see a 29% decrease in allocated objects. If you haven't already, you can read or watch more about how temporary allocated objects affect total memory use . Decreasing memory pressure on an app may allow it to be run on a smaller dyno type, or spawn more worker processes to handle…
- Engineering
- Last Updated: May 14, 2024
- Richard Schneeman
Debugging a large codebase is hard. Ruby makes debugging easier by exposing method metadata and caller stack inside Ruby's own process. Recently in Ruby 2.2.0 this meta inspection got another useful feature by exposing super method metadata . In this post we will look at how this information can be used to debug and why it needed to be added.
One of the first talks I ever wrote was "Dissecting Ruby With Ruby" all about inspecting and debugging Ruby processes using nothing but Ruby code. If you've never heard of the Method method it's worth a watch.
…
- Engineering
- Last Updated: June 03, 2024
- Richard Schneeman
Performance is important, and if we can't measure something, we can't make it fast. Recently, I've had my eye on the ActionDispatch::Static middleware in Rails. This middleware gets put at the front of your stack when you set config.serve_static_assets = true in your Rails app. This middleware has to compare every request that comes in to see if it should render a file from the disk or return the request further up the stack. This post is how I was able to benchmark the middleware and give it a crazy speed boost.
How ActionDispatch::Static Works
…
- News
- Last Updated: April 24, 2024
- Richard Schneeman
There have been thousands of reported security vulnerabilities in 2013 alone, often with language that leaves it unclear if you're affected. Heroku's job is to ensure you can focus on building your functionality, as part of that we take responsibility for the security of your app as much as we're able. On Friday, November 22nd a security vulnerability was disclosed in Ruby (MRI): CVE-2013-4164 . Our team moved quickly to identify the risk to anyone using the Heroku platform and push out a fix.
The disclosed Ruby vulnerability contains a denial-of-service vector with…
Subscribe to the full-text RSS feed for Richard Schneeman.