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 →

 

Everything is easier with Scout Client 2.0

By Derek Bullet_white Posted in Updates Bullet_white Comments Comments

We’ve released the 2nd version of our Scout client. What I love about this release is that it doesn’t make anything more complex or break compatibility with our first release. It just makes writing plugins easier.

For example – lets say you want to generate an alert. How’s this for simplicity?


class INeedASandwich < Scout::Plugin
  def build_report
     alert(:subject => "Get me a sandwich")
  end
end

We’ve also made the process for managing memory (data stored on the client between runs of the plugin) easier to work with. Memory is a great tool for storing state.

For example:


class INeedASandwich < Scout::Plugin
  def build_report
    if memory(:am_i_hungry)
      alert(:subject => "Get me a sandwich")
      remember(:am_i_hungry => false)
    else
      remember(:am_i_hungry => true)
    end
  end
end

As always, updating to the latest release is as simple as:

gem install scout [1]
gem install scout --source http://gems.scoutapp.com/

[1] Rubyforge is slow to update, in the meantime, use our gem server mirror

 

Monitor MySQL queries with Scout

By Derek Bullet_white Comments Comments

Robin Ward of Forumwarz has released a MySQL slow queries plugin for Scout that does exactly what you’d expect: sends an alert when a slow query is run.

Scout <sub> Derek Laptop

The alert contains the full query along with the query time:

Scout </sub> Alert

Note that you’ll need to enable slow query logging in your MySQL config file, but that’s just a 2 line change. See the MySQL Slow Queries directory entry for more information.

 

Meet our team at RailsConf

By Derek Bullet_white Comments Comments

Charles, myself (Derek), and Andre are boarding a plan soon for RailsConf in Portland.

If you want to do a little coding, chat about monitoring, etc. look for us there!

 

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 →

 

Older posts: 1 ... 58 59 60 61 62 ... 68