Forum: Ruby on Rails Fragment cache hit is super slow every two times

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2008-11-25 22:33
Hi,

I have a piece of html that I fragment cache. For a very strange reason
every two times I request the page, rendering the fragment cache takes a
lot of time.

Example:

1) I request index page, rendering takes 300ms
2) I request again index page, rendering takes 1300ms
3) I request again index page, rendering takes 300ms
4) and so on


Where could that come from???
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2008-11-25 22:58
Fernando Perez wrote:
> Hi,
>
> I have a piece of html that I fragment cache. For a very strange reason
> every two times I request the page, rendering the fragment cache takes a
> lot of time.
>
> Example:
>
> 1) I request index page, rendering takes 300ms
> 2) I request again index page, rendering takes 1300ms
> 3) I request again index page, rendering takes 300ms
> 4) and so on
>
>
> Where could that come from???

I try to do some profiling with script/performance/request, but it seems
broken, because when it has finished making requests, it never renders
the results. In Rails 2.1.1 it worked fine though.

Has anyone encountered this problem?
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2008-11-25 23:12
> I try to do some profiling with script/performance/request, but it seems
> broken, because when it has finished making requests, it never renders
> the results. In Rails 2.1.1 it worked fine though.
>
> Has anyone encountered this problem?

I had forgotten to use production environment for the profiling, now it
renders the results.
This topic is locked and can not be replied to.