Skip to content

Use django-cacheops to speed up serving docs and support DB going down #6321

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

Closed
wants to merge 1 commit into from

Conversation

humitos
Copy link
Member

@humitos humitos commented Oct 22, 2019

django-cacheops allows us to cache querysets into a redis backend in a
granular way. We can define which models we want to cache and we can
specify which instances (el proxito, web, workers, etc) will use this
cache and which of them will invalidate it.

This initial approach configure El Proxito to make usage of this cache
when performing queries and configure Web/Celery/Build instances only
to invalidate the cache when a model changed.

This setup allows us to serve docs faster but also keep serving docs
during CACHEOPS_TIMEOUT seconds even when the DB goes down.

Because the way it's configured now (web is not using the cache), when
the DB goes down, the footer API call will fail and the flyout menu
won't be replaced properly. We could change this if we want by
performing Manual caching on that view or by enabling cacheops in Web
instance as well.

@humitos humitos force-pushed the humitos/docker-compose branch from ad1e236 to 022136b Compare October 30, 2019 13:51
@humitos humitos changed the base branch from humitos/docker-compose to master November 26, 2019 11:47
`django-cacheops` allows us to cache querysets into a redis backend in a
granular way. We can define which models we want to cache and we can
specify which instances (el proxito, web, workers, etc) will use this
cache and which of them will invalidate it.

This initial approach configure El Proxito to make usage of this cache
when performing queries and configure Web/Celery/Build instances only
to invalidate the cache when a model changed.

This setup allows us to serve docs faster but also keep serving docs
during `CACHEOPS_TIMEOUT` seconds even when the DB goes down.

Because the way it's configured now (web is not using the cache), when
the DB goes down, the footer API call will fail and the flyout menu
won't be replaced properly. We could change this if we want by
performing Manual caching on that view or by enabling cacheops in Web
instance as well.
@humitos humitos force-pushed the humitos/el-proxito-cache branch from ca06f8b to a80604f Compare November 26, 2019 11:52
@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2020
@humitos
Copy link
Member Author

humitos commented Jan 13, 2020

We haven't rolled out completely El Proxito yet and we are not sure we are going to need this. Although, the PR does work and the approach could be interesting.

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jan 13, 2020
@stale
Copy link

stale bot commented Feb 27, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Feb 27, 2020
@humitos
Copy link
Member Author

humitos commented Feb 28, 2020

We haven't made a decision about what to do with this yet. El Proxito has been pretty stable so far and we may don't need this work at all. Although, I will leave it open for another month or so, and we can back when stale bot mentioned us again.

@stale stale bot removed the Status: stale Issue will be considered inactive soon label Feb 28, 2020
@humitos humitos added the Needed: design decision A core team decision is required label Mar 3, 2020
@humitos
Copy link
Member Author

humitos commented Apr 21, 2020

This may not be needed. Our Proxito is pretty stable now and we are adding CDN in front of it. I'm closing it for now and we can revisit in the future if we think it's still a good idea.

@humitos humitos closed this Apr 21, 2020
@stsewd stsewd deleted the humitos/el-proxito-cache branch July 28, 2020 17:58
@humitos humitos restored the humitos/el-proxito-cache branch February 27, 2023 16:23
@humitos
Copy link
Member Author

humitos commented Feb 27, 2023

I may give it a second change and see if I can implement this PR quickly into our code under a feature flag to compare execution times with the regular implementation. Maybe we can make Proxito fast without too much effort.

@humitos humitos deleted the humitos/el-proxito-cache branch February 27, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant