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
2010-07-20 06:55:09
I am running in development mode. Is that bad? I'm a complete beginner to Ruby.
hassaanm
2010-07-20 17:53:56
Edited response to be more of an actual answer
Toby Hede
2010-07-21 00:21:10
Thanks for the help!
hassaanm
2010-07-21 23:12:17