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

Option to use Redis 7.4 hash field ttl for presence #403

Merged
merged 2 commits into from
Aug 7, 2024
Merged

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Jul 31, 2024

Redis 7.4 added per HASH field TTL. Here we use it for presence information by adding new option UseHashFieldTTL to RedisPresenceManagerConfig. Benefits:

  • less memory for presence data since less data to keep (no need in separate ZSET), up to 1.6x improvement.
  • slightly better CPU utilization on Redis side since less keys to deal with in LUA scripts during presence get, add, remove operations.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.43%. Comparing base (70fd357) to head (06f5159).
Report is 1 commits behind head on master.

Files Patch % Lines
presence_redis.go 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #403      +/-   ##
==========================================
- Coverage   81.46%   81.43%   -0.03%     
==========================================
  Files          40       40              
  Lines        7174     7181       +7     
==========================================
+ Hits         5844     5848       +4     
- Misses        952      956       +4     
+ Partials      378      377       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FZambia FZambia changed the title Option to use hash field ttl for presence Option to use Redis 7.4 hash field ttl for presence Aug 2, 2024
@FZambia FZambia merged commit 8316026 into master Aug 7, 2024
8 checks passed
@FZambia FZambia deleted the hash_field_ttl branch August 7, 2024 04:32
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.

1 participant