12/23 - UPDATE - Scout Agent v5 has exited the BETA phase. If you're already using Scout, upgrade instructions appear when viewing a server at scoutapp.com.
We’ve prepared a BETA release of the Scout Agent that supports SMS notifications and makes creating your own plugins easier. We and a group of beta accounts been running it internally for some time, and now we invite you to try it out.
Get the New Agent
1) Install the Scout agent gem version 5.0.2:
sudo gem install scout
2) Change your crontab entry for Scout so it runs every minute, which is just * * * * * on Linux. Your current setup is */3, */10, or similar.
Dual-tier SMS Alerts (Ultimate Accounts only)
When things go really wrong it’s important you find out quickly. Using Scout’s triggers, you can now specify a separate threshold for SMS alerts. For example, send an email alert if disk capacity is over 70% and an SMS alert if disk capacity is over 90%). Here’s how:
1) Enter your SMS info in the new "notifications" section of Scout:
2) Edit/create a trigger. You’ll see a new option for the SMS threshold:
When the entered threshold is crossed, you’ll receive an SMS alert. SMS alerts are currently available only on Ultimate accounts.
Easier Plugin Creation and Editing
Because the new Agent pings us every minute, it is much more responsive to changes you make in configurations on Scoutapp.com. Any changes you make will be picked up within 60 seconds by the new Agent, regardless of your plan level.
Explicit Checkin Times
When you upgrade to the new Agent, you'll see the "Server Contact" box on your server homepage, providing visual confirmation of most recent and next checkin times:
Get your new Agent here:
sudo gem install
We’d love your feedback on the new Agent and functionality. Leave your comment here or send an email with with any 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.
When you get started with Scout, we try to setup sensible default triggers for events you may need to investigate on your servers.
For example, Scout generates an alert if your disk usage exceeds 85% or CPU Load over the last minute exceeds 3.
However, every server and application is different. For example, a CPU load of 3 is fine on some servers but a problem on others. We’ve made it easier to tune Scout for your setup if Scout is sending too many alerts.
Scout customer Eric Lindvall wrote up a nice piece on finding and fixing memory leaks in god -- specifically, when issuing "god load" on long-running god processes. Give it a read, it provides good insight into the troubleshooting process and the tools he used. Eric points to the Scout graphs showing both the symptoms:
And the solution:
Who wouldn't love to see memory usage go down and stabilize like that? Eric also provides patches to god in case you're having similar issues. Check out his full writeup for details.
If you're having trouble with memory consumption of a specific process, check out Scout's Process Memory Usage plugin.
Before Scout, my experience developing software was primarily consulting. Success was measured by delivering software on time and on budget.
With Scout, a subscription-based service, my focus isn’t on scheduling. We are self-funded and we didn’t have the luxury of a venture-backed startup. We’re focused on figuring out which pieces of development work can increase revenue the most. What follows is how we’re approaching it.
Sometimes you have actions in your Rails app that you know take a long time. Getting alerts on these actions is just noise.
With the updated Rails Monitoring Plugin, you can filter out any requests on which you don't want to be notified. You supply a regular expression, so you make as simple or complicated as you need to.
Update your Rails plugin
If you already have the Rails plugin installed, you need to update it. Go to plugin->code and click Update:
Then go to plugin->edit and click Update Options:
The new goodness is under "advanced options":
You provide a regular expression for actions you want don't want to be alerted on when they're slow. In the simplest case, don't even worry about it being a regular expression -- just provide a string you want to match. For example, if you don't want to be alerted to any slow actions with admin in the URI, just put admin in the Ignored Actions field.
More Complicated Matches
To ignore all actions under admin and also accounts/new, the regex is(admin|accounts\/new). If you wanted to make sure admin only matches paths starting with admin, just match the beginning slash: (\/admin|accounts\/new)
If you're building a complicated regex, try it out separately to ensure it matches/doesn't match what you expect. I dig on Rubular for quick regex sanity checks. Of course, the plugin will tell you if your regex has a problem, but you'll get faster feedback by running it through Rubular.
Note that the match is case insensitive -- no need to worry about case.
Finally, note that excluded actions will still be analyzed in the daily Rails Analysis reports, so you'll still get metrics on them -- you just won't get email notifications for actions you already know are slow!
Google Analytics is an indispensable tool as you optimize the business side of your operation. If you haven't already set up goals in Analytics for viewing your pricing information, accessing the sign-up form, and signing up for an account -- go do it! It's vital information.
However, Google Analytics' goals have to be attached to a specific URL. What if there is no URL for an important goal? For example, the New Account goal for Scout is just the account/show page -- there's no specific URL to represent a newly created account.