I'm running Redmine with Nginx/Passenger. When I first visit my site, it takes 10 seconds to get a response. Then it runs fast (only 2 seconds to respond). But if I let it sit idle for a while, it's slow to start again. So how do I get my Rails application to persist so that Nginx doesn't have to boot it up every time I want to use my site? asked 17 Jun '11, 18:24 jackdesert |
Nginx is always running, so there is no 'boot up' that happens. Something else must be causing the first request to take longer, have you analyzed the requests with a tool like Google Chrome Developers tools? This should give you a better idea on the request itself to see what is taking that long. answered 17 Jun '11, 18:35 johns |
Ok, I figured it out. I had a crontab job that was stopping, then starting Nginx every 20 minutes. And this killed the rails app until someone else visited the site to start it again. To fix this, I just used a script to see if nginx was already running. If running, do nothing. If stopped, start Nginx. answered 18 Jun '11, 08:36 jackdesert |