0

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.

1 Answer 1

1

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.

1
  • 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, 2010 at 12:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .