Can you see the passenger worker processes running on the box (after
the six hour period)?  And are you doing any page/fragment/anything
caching in the Rails app?

On Tue, Dec 20, 2011 at 10:58, Chris Mayan <[email protected]> wrote:
> Hi there,
>
> I'm having some very slow responses on view rendering of the first load of a
> site after no requests have been made to the server say after 6 or so hours.
>
> I've included some prod logs, and the Passenger configuration files (please
> see below) to show the 22 second delay.
>
> Quick background:
> a) the site redirects http requests to https.
> b) the first request is to the root of the site, which responds in a slow
> 2.4 seconds before redirecting to the https version of the page,
> c) it redirects, and the redirected view takes almost 22seconds to render.
> d) subsequent hits to the site (even from another browser on a different
> network connection that has never visited the site before) now only takes on
> average 64ms!
>
> Is this some sort of Passenger configuration problem? I've read and reread
> the Passenger configuration manual and I have set  options to stop it from
> idling down any of the spawns and / or rails environment that may cause the
> slow lag after no requests for some time.
> I've also utilised PassengerPreStart, and used MinInstances.
>
> But none of this seems to cure this problem at all.
>
> The server is also not using any swap. Here is the output from "free":
>
>                        total       used       free     shared    buffers
> cached
> Mem:       1023384     881020     142364          0      61940     188796
>   -/+ buffers/cache:     630284     393100
> Swap:       905208               0     905208
>
> Is there some Passenger/Apache configuration that I am missing?
> Is there some OS thing that is affecting the performance? (Server is virtual
> machine - is the VM starved of cpu/disk resources perhaps?)
> Have any of you experienced anything like this and/or know a way to resolve
> it?
>
> Thanks and appreciate any help or suggestions
>
> Cheers
> Chris
>
>
> Prod Logs:
> ----------------
>
> Processing SiteController#index (for x.x.x.x at 2011-12-20 09:42:01) [GET]
>   Parameters: {"action"=>"index", "controller"=>"site"}
> Redirected to https://domainname.com/
> Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected.
> Completed in 2471ms (DB: 1) | 302 Found [http://domainname.com/]
>
>
> Processing SiteController#index (for x.x.x.x at 2011-12-20 09:42:06) [GET]
>   Parameters: {"action"=>"index", "controller"=>"site"}
> Rendering template within layouts/general_layout
> Rendering site/index
> Completed in 22577ms (View: 21815, DB: 96) | 200 OK
> [https://domainname.com/]
>
>
> Processing SiteController#index (for x.x.x.x at 2011-12-20 09:43:03) [GET]
>   Parameters: {"action"=>"index", "controller"=>"site"}
> Rendering template within layouts/general_layout
> Rendering site/index
> Completed in 64ms (View: 56, DB: 25) | 200 OK [https://domainname.com/]
>
>
>
> Passenger.conf:
> -------------------------
> <IfModule mod_passenger.c>
>   PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.9
>   PassengerRuby /usr/bin/ruby1.8
>   PassengerUseGlobalQueue On
>   PassengerSpawnMethod smart
>   PassengerFriendlyErrorPages Off
>   PassengerMinInstances 5
>   PassengerPoolIdleTime 0
>   PassengerHighPerformance on
>   PassengerLogLevel 0
>   RailsFrameworkSpawnerIdleTime 0
>   RailsAppSpawnerIdleTime 0
> </IfModule>
>
>
> In the individual site config I have:
> --------------------------------------------------
> PassengerPreStart https://domainname.com
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to