-
Notifications
You must be signed in to change notification settings - Fork 637
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
Cache subscriber to decrease query count #6822
base: master
Are you sure you want to change the base?
Conversation
We had a discussion with @mekya, we will count mongodb calls and use it in cluster integration test to verify cache approach reduces mongodb load. Regarding to design, cache approach is approved and we will proceed with it. |
Cluster integration test added: |
Quality Gate passedIssues Measures |
#6783
Subscriber cache implemented using Caffeine to decrease mongodb load on subscriber read.
Subscriber read is called many times on
SubscriberBlockFilter.java
forsubscriber.isBlocked()
,checkIsTimedBasedSubscriber()
and for webrtc play/publishisSubscriberBlocked()
ofWebSocketEnterpriseHandler.java
I used Caffeine because it has useful optimization features such as
expireAfterWrite
testing confirms that it works well.
SUBSCRIBER_CACHE_EXPIRE_SECONDS set to 30, it can be lowered for possible syncronization issues.
executed-query-count rest api end point added for integration testing.
Cluster integration test:
https://gitlab.com/Ant-Media/testcluster/-/merge_requests/102