"HowTo" Posts

Production Rails Tuning with Passenger: PassengerMaxProcesses

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

Our co-author today is Jesse Newland, CTO of RailsMachine. Jesse keeps RailsMachine customers up and running and troubleshoots their toughest problems. We’re pleased to have him share some of his expertise on Phusion Passenger tuning.

Say your Rails application is running in production and it’s getting good traffic. Performance isn’t as good you would like. You’ve already determined that your database is not the bottleneck. What’s your next move?

There is a good chance that Passenger’s PassengerMaxPoolSize needs to be adjusted. PassengerMaxPoolSize specifies how many instances of your application Passenger will spin up to service incoming requests. If you were running Mongrels back in the day, PassengerMaxPoolSize is equivalent to the number of mongrels you configured for your app. The value of PassengerMaxPoolSize has a major bearing on your application’s performance.

Read More →


The 3 pillars of our Rails Monitoring Stack

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

Life as a cross-dresser must be unnerving. I could buy a wig, put some makeup on my adam’s apple. Buy a skirt. Does a sock-filled bra work for my bosom?

With a bit of mood lighting, I might actually look like a woman, but it would be difficult to relax. Knowing my manhood could be exposed in a multitude of ways – some stubble on my chin, hair on my legs, forgetting to make my voice less deep, etc. would leave me on-edge.

In some ways, I feel like I identified with cross-dressers before we solidified our Rails monitoring stack over the past year. I just felt vulnerable – that one wrong move could send our Rails stack tumbling.

We’ve standardized our setup, and I thought I’d share the 3 tools we’re using that make me feel much less like a cross-dresser these days.

The 3 pillars of our Rails monitoring stack

We break Rails monitoring into the 3 parts below (along with the tools we use):

Process Monitoring

System Performance

Exception Notifications


“The Diaper”

A safeguard for emergencies

“The Nerves”

Preventing future problems

“The Megaphone”

A loud voice when your app is breaking
Monit Scout Exception Notification plugin
Ensure Mongrels are running & restart leaking processes Catch disturbing trends before they become problems – disk space usage, server load, slow requests, etc. Organizing and collecting application exceptions

So, to be clear, even though we built Scout, we use a combination of tools to make sure our Rails apps are running.

Read More →


4 Simple Steps to Detect & Fix Slow Rails Requests

By Derek Bullet_white Posted in HowTo Bullet_white Comments 11 comments

2016 UPDATE: We’ve released Scout App Monitoring, which automates these steps for you.

In Blink, Malcom Gladwell’s book on split-second decisions, Gladwell tells the story of how the Emergency Department at Chicago’s Cook County Hospital changed their process for diagnosing chest pain.

Dr. Brendan Reilly instituted a simple test to determine whether a patient was suffering from a heart attack. It combined just 4 questions with the results of an ECG. This simple test was 70% better than the barrage of questions previously asked by hospital staff to identify patients that weren’t having a heart attack and was nearly 20% better at identifying patients that were having heart attacks.

More information on the patient’s symptoms often led to an incorrect diagnosis. It distracted doctors from the real issues.

I’ve seen this many times with developers trying to debug performance issues in Rails applications. They look at outliers instead of the obvious culprits. It’s part of the reason I’ve never felt a need for a deep, detailed Rails monitoring application (i.e. – benchmarks from the controller to the database level on every request).

The majority of the time, our performance problems have nothing to do with the Rails framework (and we’ve worked through a lot of issues since we started building Rails apps in 2005). Why benchmark the entire request cycle when the vast majority of issues are isolated at the database layer? After I’ve ruled out the database, I can see benchmarking a single request (there’s a great free tool below), but I simply don’t want the other, often irrelevant information clouding my mind.

The root symptom we want to avoid in our apps is slow requests. Our Scout plugin for analyzing slow Rails requests has been installed nearly 250 times, so we’re not alone there.

Read More →


Monitoring Amazon EC2 Instances

By Derek Bullet_white Posted in Examples, HowTo Bullet_white Comments Comments

UPDATED – We’ve made it even easier to monitor ec2 instances. Check out our post on cloud monitoring.

Read More →


Giving your web host access to your Scout account

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

A couple of times already, we’ve seen users give their web host access to their Scout account.

It’s a big help when debugging problems – especially things that a basic monitoring tool might not pick up (like slow web requests).

Read More →


How we handle background jobs

By Derek Bullet_white Posted in HowTo Bullet_white Comments Comments

We run background jobs on our Scout servers. Lots of them.

As we’ve grown, they’ve used dramatically more resources. We needed a way to simmer them down. Most of these jobs load the entire Rails environment – that’s a hefty overhead.

We’ve modified how we run background jobs and we’re seeing great results. If you’re interested in what we did, checkout Charles’ post on our Highgroove blog.

And finally, here’s the obligatory semi-promotional graph, generated by Scout, of how the load dramatically decreased after implementation:

Scout ~ Edit Graph


Older posts: 1 ... 3 4 5 6