Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm managing a small social media site, and its been for the past few days experiencing intermittent server lags. The site will choke loading a page, and moments later, the same page will have no difficulty loading.

What is the best way to detect server latency, and how to address it?

My box is..

Running on MongrelDB with mySQL through Ruby on Rails

All dynamic images and the database are hosted via S3

High CPU Med (32 bit)
5 ECU, 1.7GB RAM
350GB Non-persistent storage 

Traffic is roughly 60 pageviews / day.

share|improve this question
up vote 1 down vote accepted

Are you monitoring server load?

There's performance tools for RoR that can measure your server's performance when running RoR scripts, but I can't remember the name offhand. Shouldn't be too hard to find it, though. The one I am thinking about was discussed on the Ruby on Rails podcast.

Are you checking the logs for errors?

You're saying server latency, but it may not be latency at all. It could very well be a performance issue on the server. Does it run low on memory due to a bug? Processes getting killed after running errant?

Can you monitor the server to see what top says is happening at the time of one of these lags?

Sounds almost like something has to be transferred or moved into working memory and after that is being cached so it's running quickly when asked for again, unless something is being proxied or hung up somewhere. If the server itself isn't having any issues show up, you would need to diagnose if it's you or everyone having the occasional lag.

There are test tools out there for measuring performance. Maybe you should look into one of those services to test your server and profile the RoR/database code.

You might also want to consider installing some kind of server monitoring software like Nagios to alert you when/if a resource is running low or if there's an alert condition to check on.

share|improve this answer
I do have emails sent me. Nothing is overloading abnormally or underloading. Just found Scout for RoR. Looks great. I just manually cleared cached and reloaded the pages, and that doesn't seem to be the source of the problem. Everyone in my office can account for it, but we all share the same network connection ( cable modem ). Thanks for all your tips. It's a great help. – Trip Oct 5 '10 at 12:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.