views:

20

answers:

1

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?

+1  A: 

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.

Toby Hede
I am running in development mode. Is that bad? I'm a complete beginner to Ruby.
hassaanm
Edited response to be more of an actual answer
Toby Hede
Thanks for the help!
hassaanm