You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.
Reporter: openstreetmap[at]firefishy.com [Submitted to the original trac issue database at 7.49am, Monday, 13th October 2008]
Since Rails 2.0 all ActiveRecord queries are cached.
Caching is unneeded, slows down API and uses more memory. I suspect it negatively affects garbage collection.
Attached is a patch which disables AR Query Cache globally. ~15% API speed improvement on my test setup. Ideal would be to only disable for API requests.
config/initializers/query_cached_off.rb
The text was updated successfully, but these errors were encountered:
Author: tom[at]compton.nu [Added to the original trac issue at 8.46am, Monday, 13th October 2008]
What is the basis of your statement that caching is unneeded? Presumably the rails developers didn't add it for fun, and given that there is (judging from your patch) no easy way to turn it off it seems odd that it would never be of any use.
I can understand that it may not be a good idea for the API but are you really saying that absolutely none of our code benefits from it?
Author: tom[at]compton.nu [Added to the original trac issue at 4.43pm, Monday, 13th October 2008]
Having now looked at the query cache code in rails I'm very much inclined to agree that turning it off globally may be a good thing - it is stunningly bad code that is missing any attempt whatsoever to manage the size of the cache so it has the potential to eat memory like mad.
It also has at least one wonderful bug that I spotted from a simple code inspection - if you change the database inside an uncached block that the cache won't be cleared so when you leave the uncached block you will have a stale cache... So using uncached blocks in critical places is probably not a good solution for us.
Reporter: openstreetmap[at]firefishy.com
[Submitted to the original trac issue database at 7.49am, Monday, 13th October 2008]
Since Rails 2.0 all ActiveRecord queries are cached.
Caching is unneeded, slows down API and uses more memory. I suspect it negatively affects garbage collection.
Attached is a patch which disables AR Query Cache globally. ~15% API speed improvement on my test setup. Ideal would be to only disable for API requests.
config/initializers/query_cached_off.rb
The text was updated successfully, but these errors were encountered: