WebFaction
Community site: login faq

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's gravatar image

jackdesert
1145
accept rate: 0%


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.

permanent link

answered 17 Jun '11, 18:35

johns's gravatar image

johns ♦♦
5.0k29
accept rate: 23%

edited 17 Jun '11, 18:35

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.

permanent link

answered 18 Jun '11, 08:36

jackdesert's gravatar image

jackdesert
1145
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×183
×105
×46
×26
×25

question asked: 17 Jun '11, 18:24

question was seen: 5,522 times

last updated: 18 Jun '11, 08:36

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2017 PARAGON INTERNET GROUP LIMITED
WEBFACTION IS A SERVICE OF PARAGON INTERNET GROUP LIMITED
REGISTERED IN ENGLAND AND WALES 7573953 - VAT REGISTRATION NUMBER 182147021
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM