I use mongoid 4.0
with servers hosted in a cloud service (A Ubuntu VM @ Windows Azure).
avril14th@avril14th-ubuntu:~/src/white$ rails c
Loading production environment (Rails 4.1.4)
2.1.2 :001 > User.count
=> 0
Now, if I leave the console or server idle for say 5 minutes and go again:
2.1.2 :002 > User.count
this can remain idle for hours, never returning. Only way for me to get connection back is to close the server/console and start again.
What is the trick to keep a connection alive whatever happens?