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 #872

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Aug 7, 2024

Proposed changes

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

  • less memory in Redis for presence information 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.

This PR uses an option in Centrifuge introduced in centrifugal/centrifuge#403

By default, Centrifugo will continue using the current presence implementation with ZSET since the new option only works with Redis >= 7.4 and requires explicit intent to be used.

@FZambia FZambia merged commit 3a2558a into master Aug 12, 2024
4 checks passed
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