Skip to content
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

Adding async redis caching #811

Merged
merged 95 commits into from
Nov 2, 2020
Merged

Adding async redis caching #811

merged 95 commits into from
Nov 2, 2020

Conversation

mattyweb
Copy link
Collaborator

First version with Redis caching

  • including aiocache library
  • using Pickle serialization
  • adding Redis container
  • added some tests
  • added faster requests loader script
  • redid map/clusters
  • created stubs for other legacy routes

@mattyweb
Copy link
Collaborator Author

mattyweb commented Sep 22, 2020

Other than the map essentials, shim routes are placeholders:

  • open-requests
  • map/pins
  • visualizations
  • comparison/frequency
  • comparison/timetoclose
  • comparison/counts
  • feedback

Needs infrastructure to be "productionized" (e.g. Redis, Gunicorn)

Needs data loading

@mattyweb
Copy link
Collaborator Author

mattyweb commented Sep 23, 2020

Need to keep tweaking Redis behavior

Will see "Connection <RedisConnection [db:0]> has pending commands, closing it." messages if new requests come in before the previous one has finished.

As a result may see "Redis set cache timeout error" or

Ignore set errors, and do a CACHE_MAX_RETRIES attempts to get the cache.

This sometimes will results in a loop which will return a 429 HTTP error. These errors show up in client.

Need to tweak max retries, cache timeout, pool size, cache eviction policy and cache max memory size.

Also, might want to revisit whether JSON serialization is better than Pickle...

@mattyweb
Copy link
Collaborator Author

OK. Also added Sentry using the ASGI extension. Problem with the free account is it's single-user, but we could create a shared account. Biggest value would be setting up alerts that go to Slack.

@mattyweb
Copy link
Collaborator Author

now works with the version 2 UI
the shim now supports the map/pins and open-requests endpoints

@jmensch1 jmensch1 merged commit 0027fa7 into dev Nov 2, 2020
@jmensch1 jmensch1 deleted the add-async-redis branch November 2, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants