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

[feature] sentinel use info sentinel command to run faster #1511

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

kukey
Copy link
Contributor

@kukey kukey commented Jan 6, 2025

In sentinel cluster, sentinels will send info command to collect valkey-server state;
but in large cluster, the info command response is heavy and slow, so we need some
simple info response for sentinel.

changes in this pr:

valkey-server:

  • add info-simple-for-sentinel flag, to distinguish the valkey-server is support simple info;
  • info command add sentinel subcommand, to cover sentinel used info

sentinel:

  • sentinelValkeyInstance struct add info_simple flag;
  • sentinelSendPeriodicCommands will check info_simple to send diff comamnd;
  • reconnect valkey instacne, reset info_simple flag;
  • handle info response from server to parse info_simple flag

performence test:

  • info comamnd:
    valkey-benchmark -q -n 1000000 info
    info: 65841.45 requests per second, p50=0.703 msec
  • info sentinel:
    valkey-benchmark -q -n 1000000 info sentinel
    info sentinel: 236910.67 requests per second, p50=0.111 msec

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 67.50000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 70.83%. Comparing base (b3b4bdc) to head (2837997).
Report is 2 commits behind head on unstable.

Files with missing lines Patch % Lines
src/sentinel.c 0.00% 7 Missing ⚠️
src/server.c 81.81% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1511      +/-   ##
============================================
- Coverage     70.83%   70.83%   -0.01%     
============================================
  Files           120      120              
  Lines         64911    64930      +19     
============================================
+ Hits          45982    45993      +11     
- Misses        18929    18937       +8     
Files with missing lines Coverage Δ
src/config.c 78.33% <ø> (ø)
src/server.h 100.00% <ø> (ø)
src/server.c 87.33% <81.81%> (-0.14%) ⬇️
src/sentinel.c 0.00% <0.00%> (ø)

... and 10 files with indirect coverage changes

@kukey kukey force-pushed the opti-sentinel-info-simple branch from 2837997 to 2a5d3f6 Compare January 6, 2025 13:54
@@ -3373,6 +3373,9 @@ standardConfig static_configs[] = {
createSpecialConfig("replicaof", "slaveof", IMMUTABLE_CONFIG | MULTI_ARG_CONFIG, setConfigReplicaOfOption, getConfigReplicaOfOption, rewriteConfigReplicaOfOption, NULL),
createSpecialConfig("latency-tracking-info-percentiles", NULL, MODIFIABLE_CONFIG | MULTI_ARG_CONFIG, setConfigLatencyTrackingInfoPercentilesOutputOption, getConfigLatencyTrackingInfoPercentilesOutputOption, rewriteConfigLatencyTrackingInfoPercentilesOutputOption, NULL),

/* Capabalities */
createBoolConfig("info-simple-for-sentinel", NULL, IMMUTABLE_CONFIG, server.info_simple_for_sentinel, 1, NULL, NULL),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this config only for sentinel? If yes, I think it should be moved to sentinel.c, we have some specific config parameters for sentinel node.

@kukey
Copy link
Contributor Author

kukey commented Jan 8, 2025 via email

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.

3 participants