-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove queryset caching support #6639
Comments
Are there any quantitative numbers on how much the removal of caching would hurt specific API endpoints, or a way to disable the cache in an existing 2.11 environment to evaluate what the impact of this change would be? As a user, I'm certainly in favor of reducing the complexity of the stack, but my deployment has a number of identical queries run by external monitoring repeatedly and losing the cache there could put a lot more easily-cached load on the database. (Although I do suspect Redis isn't making much difference, I don't have a way to prove it.) |
@jhujhiti You can test on your own deployment by toggling the caching feature on and off. Setting |
Great! No discernible impact on the 95th or 50th percentile latency on the API endpoints I've been monitoring. Consider this a vote in favor. |
Very low impact in our environment. Not noticeable in every day use. I'd say: kick it! |
As mentioned in issue #6651. The check_release process will be impacted by cache removal. However check_release can easily rely on RQ result caching ( When browsing the home page it is possible to check in the RQ registries for the latest I think that setting the check_release job with a result_ttl to 86400s is acceptable to check for an update every day. |
Just to add a +1 here. Databases like postgres have very good internal cache mechanisms, and I never saw any benefit in adding a layer on top. Caching of HTML rendering might have some justification, but only for pages which are viewed by multiple people and fetched repeatedly - which would probably only be the front page, and even then it varies by the user's permissions. |
I should clarify that this is just removing queryset caching. We will still maintain a Redis-based cache for generic caching functions (e.g. checking for the latest NetBox release). We will likely replace django-cacheops with django-redis, which includes support for Redis Sentinel. |
Closes #6639: Replace django-cacheops with django-redis for caching
Proposed Changes
Remove the support for query caching that was introduced in v2.6 under #2647. This would remove django-cacheops as a dependency and eliminate the
REDS['caching']
andCACHE_TIMEOUT
configuration parameters.Justification
Since its implementation, we have been constantly chasing numerous bugs attributable to limitations in the caching engine. I have addressed some of these issues within django-cacheops itself, however we continue to run into problems, particularly where complex workflows are involved.
In my opinion, it does not make sense to continue burning time chasing these bugs to support a feature with relatively little benefit. I would prefer to optimize NetBox itself where necessary to meet performance expectations rather than trying to keep the caching layer intact. I've opened this issue for discussion to see what the community thinks.
The text was updated successfully, but these errors were encountered: