Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After a long idle-time the server take very long to deliver the first page. #133

Closed
FooBarWidget opened this issue May 29, 2014 · 11 comments

Comments

@FooBarWidget
Copy link
Member

From brejoc on April 22, 2008 15:31:17

What steps will reproduce the problem? 1. Start a rails application.
2. Leave it alone for a few hours. (perhaps 4-9 hours)
3. The first request should take nearly 1 minute. First the delivery of the html takes very long and
then it takes about 2 seconds for every picture to show up one after another.
4. After that first request everything is working fine and fast. What version of the product are you using? On what operating system? • Debian Etch 4.0
• Rails 1.2.6
• Ruby: ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]

Seems that it takes mod_rails rather long to start the first rails-instance. Perhaps it would help to
introduce the option RailsMinPoolSize for rails applications with a more critical response time that
are not often needed.

Original issue: http://code.google.com/p/phusion-passenger/issues/detail?id=32

@FooBarWidget
Copy link
Member Author

From honglilai on April 22, 2008 10:14:53

RailsMinPoolSize wouldn't really help, because if Apache serves multiple Rails
applications, then application A's instances cannot be reused for application B.

However, the FrameworkSpawner server can reduce startup time because it preloads the
entire Rails framework (which usually accounts for at least half of the startup
time). Currently the idle timeout for this is a constant and is not configurable. In
the future, a configuration option can be added.

If you want to change the timeout, please edit lib/passenger/spawn_manager.rb,
constant FRAMEWORK_SPAWNER_MAX_IDLE_TIME.

Labels: -Type-Defect Type-Enhancement

@FooBarWidget
Copy link
Member Author

From brejoc on April 25, 2008 02:26:34

Thank you for you quick reply, honglilai!

In my case (currently only one simultaniously used version of rails) it worked without any downside.

@FooBarWidget
Copy link
Member Author

From cpisto on May 22, 2008 10:47:39

I definitely agree that "RailsMinPoolSize" (per vhost) would be the most intuitive,
and arguably correct, solution

@FooBarWidget
Copy link
Member Author

From google%brianjohnson.cc@gtempaccount.com on October 04, 2008 07:31:25

I think honglilai is correct, a better solution would be PassengerMinInstancesPerApp

@FooBarWidget
Copy link
Member Author

From frankske on December 08, 2008 03:48:16

I agree on the PassengerMinInstancesPerApp. You'd want at least one instance running per app!

@FooBarWidget
Copy link
Member Author

From drothlis on January 24, 2009 06:18:34

It would be really useful to have a directive similar to PassengerMaxInstancesPerApp,
but setable individually for each app/virtualhost.

(I run a critical app along with several low-traffic, non-critical apps on the same
server; I would like each of the non-critical apps to have at most one instance
running, leaving several instances available for the critical app.)

@FooBarWidget
Copy link
Member Author

From will.bryant on February 27, 2009 17:30:40

I'd really like a PassengerMinInstancesPerApp. I get about 5s startups, which is too poor for me.

To the original commenter though, instances should not take a minute to start under any circumstances. It
shouldn't take noticeably longer than it takes to run up a script/server, so I'd suggest you try that. If the server
is badly overloaded, you need a better server; if the server isn't loaded but startup seems to freeze up, fire up a
debugger and see what it's doing - it may be freezing up trying to get something off the network before timing
out, for example.

@FooBarWidget
Copy link
Member Author

From dolzenko on September 17, 2009 23:26:44

Ow, just wasted some time looking through the code and not reading docs throughly before
that, but anyway it seems to be worth adding to the first comment that the configuration
options were added for this: http://www.modrails.com/documentation/Users%20guide %20Apache.html#_railsframeworkspawneridletime_lt_integer_gt http://www.modrails.com/documentation/Users%20guide %20Apache.html#_railsappspawneridletime_lt_integer_gt

@FooBarWidget
Copy link
Member Author

From dolzenko on September 17, 2009 23:27:48

Screwed the links, these are to the following sections from the docs:

5.14.5. RailsFrameworkSpawnerIdleTime
5.14.6. RailsAppSpawnerIdleTime

@FooBarWidget
Copy link
Member Author

From honglilai on November 17, 2009 11:05:25

PassengerMinInstances has been implemented in a not-yet-published refactoring branch.
Will push when the time is right.

Status: Fixed
Labels: Milestone-3.0.0

@FooBarWidget
Copy link
Member Author

From steffen.hiller on November 17, 2009 13:38:05

Interesting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant