Upgrading to Rails 5.2 temporarily slowed down my site
Robb Shecter May 10
That little rocket is when I deployed. A big time bump shows up, a drop, and then more increasing. (Lower values are better.)
My first thought? There's something messed up in Rails 5.2. I looked at the logs, saw the slow response times, and nothing obvious stood out to me. On a whim, I took a look at the Rails cache. I use memcached on Heroku by MemCachier. It's got a nice dashboard including this graph:
That crash in the hit rate is exactly when I upgraded Rails. The performance immediately went through the floor.
What hypothesis would fit these phenomena? My conclusion: Rails 5.2 changes the way that cache keys are generated. The shape of the graph after the upgrade is very interesting – it's gradually trending back up to the original value. (Here, higher is better.)
At the time, I also increased the available memory for memcached, thinking that would help. I now believe that was a mistake: all of the existing keys would be evicted, and the full memory is essentially available for the new formatted key.
Tonight I got some strong evidence for my hunch: the cache key format has been changed.
So I'm 98% sure of these conclusions, but don't have independent confirmation. If you see a similar performance hit, no you're not crazy, and no, Rails 5.2.0 doesn't suck. Give it a little time, and the speed will return to normal.