Ruby on Rails server freezes / lags randomly for a long time

I have a program that makes a simple Ruby on Rails server live. The server is used to communicate and map data between computers on the same network. I did not do anything unusual for Ruby stuff. I just used the scaffold to create 3 models, and that’s it. The problem is that after some time (many HTTP requests between computers and the server ~ = 10 minutes) the server starts to lag and just hangs forever, forcing me to kill the script server and restart it. Any help / suggestions?

+3
source share
1 answer

Are you working in development mode or have class caching disabled?

Often you can find systems working in development mode to run some problems. It's not that important when you are working, and you can just restart the dev server, but it can be very annoying if you have a working system.

The key issue is config / environment / development.rb:

# In the development environment your application 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

This not only slows down the response time, but can lead to a slow memory leak and unpredictable behavior over time.

+3
source

Source: https://habr.com/ru/post/1755159/


All Articles