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

Support customizing the session manager Redis connection #44

Open
cupakromer opened this issue Aug 4, 2020 · 0 comments
Open

Support customizing the session manager Redis connection #44

cupakromer opened this issue Aug 4, 2020 · 0 comments
Labels
enhancement New feature or request performance

Comments

@cupakromer
Copy link
Contributor

Follow-up to #41

For performance reasons it would be good to allow a more robust Redis session manager. Two ideas for this are:

  • Usage of a connection pool

    An app with many threads can run into bottle necks with a single Redis connection. This is due to Ruby's GVL and the fact the Redis connection is thread safe. With Ruby's GVL, it ensures only 1 ruby thread is active at a time; but IO does not count towards this. The Redis connection is protected to ensure only 1 thread is actively communicating on it at a time. So what can happen is the Redis connection submits Thread-A's request over IO, which allows Thread-B to run. Thread-B attempts to access the session manager, but becomes blocked as Thread-A's IO hasn't returned or been processed yet.

    Usage of a connection pool alleviates this issue as it allows multiple connections to exist side-by-side. However, we need to balance the need of many apps, with many connection pools, having to access a shared Redis instance or cluster.

  • Add an in-memory cache tier

    The reason for this is when someone sends multiple requests in-rapid succession (maybe HTTP API calls). We don't want to necessarily hit the network every time when we just checked the validity of the data.

@cupakromer cupakromer added enhancement New feature or request performance labels Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

1 participant