Ruby on Rails Server hangs/lags randomly for long periods

I have a program that makes a simple Ruby on Rails server go live. The server is used to communicate and collate data between computers on the same network. I have not done anything fancy to the Ruby stuff. I have simply used scaffold to generate 3 models and that is it. The problem is that after a while (many HTTP requests between the computers and the server ~= 10 minutes) the server starts to lag and just hangs forever, forcing me to kill the server script and restarting it. Any help/suggestions?

-------------Problems Reply------------

Are you running in development mode or have the class caching turned off?

It is not uncommon to find systems running in development mode to start hitting some issues. Not such a big deal when you are working and can simply restart the dev server, but can be very annoying once you have a working system.

The key issue is in config/environments/development.rb:

# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.

config.cache_classes = false

Not only does this slow down response time, but it can lead to slow memory leaks and unpredictable behaviour over time.

Category:ruby on rails Views:8 Time:2010-07-18

Related post

Copyright (C), All Rights Reserved.

processed in 0.135 (s). 11 q(s)