The deployment scenario…
Apache2 on shared host, proxying to lighttpd, which has 3 external
fcgis running on localhost. The fcgis are managed by spinner/spawner.
We’re noticing a definite speed issue on “first requests” to this site.
- Hit the site a few times, paying no attention to load time
- Wait x period of time (haven’t quite narrowed this down yet, but
probably 5-10 mins)
- Hit site again once - this request will take anywhere from 5 - 30
or so seconds
- Reload site a few times - these requests will be very quick - less
than one second
These load times are reflected not just in the “feel” we get from
using the site, but are confirmed by the production.log
What’s odd is that the time seems to be inconsistent with where it
happens. The DB portion of the time is always very very small, even
on the “first request” long requests. The overall completed time,
for example, might be 10 seconds. Sometimes the ‘Rendering’
component would be 6-7 seconds of that overall time, but sometimes it
will be very small (under 1 second) and the other 8-9 seconds that
aren’t explained by either Rendering or DB time are lost
- Has anyone seen this issue before and know what the problem is?
- Are there settings in any of apache2, lighttpd or rails itself that
I’m unaware of which might cure this?
The app uses the Globalize plugin, but is otherwise pretty standard.
We’ve tried most combinations of switching between rails 1.0 and
rails 1.1.2, tweaking ActionController::Base.allow_concurrency (we
were also getting the “dropped mysql conn” errors in dev mode…),
tweaking ActionView::Base.cache_template_loading (thought that might
be slowing views down?), and so on all to no avail.