Remove configuration: hash-field-expiry-bits
This commit is contained in:
parent
b2a9222597
commit
f1f715ab79
18
redis.conf
18
redis.conf
|
@ -133,7 +133,7 @@ protected-mode yes
|
|||
# enable-protected-configs no
|
||||
# enable-debug-command no
|
||||
# enable-module-command no
|
||||
enable-debug-command local
|
||||
|
||||
# Accept connections on the specified port, default is 6379 (IANA #815344).
|
||||
# If port 0 is specified Redis will not listen on a TCP socket.
|
||||
port 6379
|
||||
|
@ -1922,8 +1922,7 @@ latency-monitor-threshold 0
|
|||
# By default all notifications are disabled because most users don't need
|
||||
# this feature and the feature has some overhead. Note that if you don't
|
||||
# specify at least one of K or E, no events will be delivered.
|
||||
#notify-keyspace-events ""
|
||||
notify-keyspace-events Elg
|
||||
notify-keyspace-events ""
|
||||
|
||||
############################### ADVANCED CONFIG ###############################
|
||||
|
||||
|
@ -2221,19 +2220,6 @@ rdb-save-incremental-fsync yes
|
|||
# max-new-connections-per-cycle 10
|
||||
# max-new-tls-connections-per-cycle 1
|
||||
|
||||
# If expected to use hash-field-expiration feature at scale, it is recommended to
|
||||
# consider setting the hash-field-expiry-bits configuration to a value greater
|
||||
# than 0. This value reduces the precision of expiration time by rounding up X
|
||||
# LSB bits. That is, it may delay the expiration of fields by up to 2^X msec.
|
||||
# This optimization improves memory usage and performance by aggregating fields
|
||||
# with similar expiry values (within 2^X msec intervals). It's worth noting that
|
||||
# this optimization can also be implemented on the client side by simply normalizing
|
||||
# and aggregating expiry values before sending them to Redis.
|
||||
#
|
||||
# For example if X=10 then it might add delay of about 1sec. (X=16 leads to around
|
||||
# 65 seconds delay, X=22 to approximately 1.1 hours, X=26 to roughly 0.7 days, etc.)
|
||||
#
|
||||
# hash-field-expiry-bits 0
|
||||
|
||||
########################### ACTIVE DEFRAGMENTATION #######################
|
||||
#
|
||||
|
|
|
@ -3172,7 +3172,6 @@ standardConfig static_configs[] = {
|
|||
createIntConfig("rdb-key-save-delay", NULL, MODIFIABLE_CONFIG | HIDDEN_CONFIG, INT_MIN, INT_MAX, server.rdb_key_save_delay, 0, INTEGER_CONFIG, NULL, NULL),
|
||||
createIntConfig("key-load-delay", NULL, MODIFIABLE_CONFIG | HIDDEN_CONFIG, INT_MIN, INT_MAX, server.key_load_delay, 0, INTEGER_CONFIG, NULL, NULL),
|
||||
createIntConfig("active-expire-effort", NULL, MODIFIABLE_CONFIG, 1, 10, server.active_expire_effort, 1, INTEGER_CONFIG, NULL, NULL), /* From 1 to 10. */
|
||||
createIntConfig("hash-field-expiry-bits", NULL, MODIFIABLE_CONFIG, 0, 30, server.hash_field_expiry_bits, 0, INTEGER_CONFIG, NULL, NULL), /* From 0 to 30. */
|
||||
createIntConfig("hz", NULL, MODIFIABLE_CONFIG, 0, INT_MAX, server.config_hz, CONFIG_DEFAULT_HZ, INTEGER_CONFIG, NULL, updateHZ),
|
||||
createIntConfig("min-replicas-to-write", "min-slaves-to-write", MODIFIABLE_CONFIG, 0, INT_MAX, server.repl_min_slaves_to_write, 0, INTEGER_CONFIG, NULL, updateGoodSlaves),
|
||||
createIntConfig("min-replicas-max-lag", "min-slaves-max-lag", MODIFIABLE_CONFIG, 0, INT_MAX, server.repl_min_slaves_max_lag, 10, INTEGER_CONFIG, NULL, updateGoodSlaves),
|
||||
|
|
|
@ -1853,10 +1853,6 @@ void addItems(ebuckets *eb, uint64_t startExpire, int step, uint64_t numItems, M
|
|||
}
|
||||
}
|
||||
|
||||
/* mimic configuration "hash-field-expiry-bits" */
|
||||
int hashFieldExpiryBits = 0;
|
||||
#define ROUND(v) (v + ((1<<hashFieldExpiryBits)-1)) & ~((1<<hashFieldExpiryBits)-1)
|
||||
|
||||
/* expireRanges - is given as bucket-key to be agnostic to the different configuration
|
||||
* of EB_BUCKET_KEY_PRECISION */
|
||||
void distributeTest(int lowestTime,
|
||||
|
@ -1881,7 +1877,7 @@ void distributeTest(int lowestTime,
|
|||
uint64_t endRange = EB_BUCKET_EXP_TIME(expireRanges[i]);
|
||||
for (int j = 0; j < ItemsPerRange[i]; j++) {
|
||||
uint64_t randomExpirey = (rand() % (endRange - startRange)) + startRange;
|
||||
randomExpirey = ROUND(randomExpirey);
|
||||
randomExpirey = randomExpirey;
|
||||
expItemsHashValue = expItemsHashValue ^ (uint32_t) randomExpirey;
|
||||
MyItem *item = zmalloc(sizeof(MyItem));
|
||||
getMyItemExpireMeta(item)->next = listOfItems;
|
||||
|
@ -1978,13 +1974,13 @@ int ebucketsTest(int argc, char **argv, int flags) {
|
|||
#ifdef EB_TEST_BENCHMARK
|
||||
TEST("ebuckets - benchmark 10 million items: alloc + add + activeExpire") {
|
||||
/* All mapped to same EB_BUCKET_KEY() */
|
||||
//uint64_t expireRanges[] = { 1805092100000, ROUND(1805092100001)}; // 1 msec distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, ROUND(1805092101000)}; // 1 sec distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, ROUND(1805092160000)}; // 1 min distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, ROUND(1805095700000)}; // 1 hour distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, ROUND(1805178500000)}; // 1 day distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, ROUND(1805696900000)}; // 1 week distribution
|
||||
uint64_t expireRanges[] = { 1805092100000, ROUND(1807684100000)}; // 1 month distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, 1805092100001}; // 1 msec distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, 1805092101000}; // 1 sec distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, 1805092160000}; // 1 min distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, 1805095700000}; // 1 hour distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, 1805178500000}; // 1 day distribution
|
||||
//uint64_t expireRanges[] = { 1805092100000, 1805696900000}; // 1 week distribution
|
||||
uint64_t expireRanges[] = { 1805092100000, 1807684100000}; // 1 month distribution
|
||||
int itemsPerRange[] = { 0, 10000000 };
|
||||
|
||||
/* expireRanges[] is given as bucket-key values */
|
||||
|
|
|
@ -1730,8 +1730,6 @@ struct redisServer {
|
|||
int active_expire_enabled; /* Can be disabled for testing purposes. */
|
||||
int active_expire_effort; /* From 1 (default) to 10, active effort. */
|
||||
int lazy_expire_disabled; /* If > 0, don't trigger lazy expire */
|
||||
int hash_field_expiry_bits; /* LSB bits to discard from HFE expiration
|
||||
* value. Optimize HFE DS by reducing precision. */
|
||||
int active_defrag_enabled;
|
||||
int sanitize_dump_payload; /* Enables deep sanitization for ziplist and listpack in RDB and RESTORE. */
|
||||
int skip_checksum_validation; /* Disable checksum validation for RDB and RESTORE payload. */
|
||||
|
|
14
src/t_hash.c
14
src/t_hash.c
|
@ -1949,20 +1949,6 @@ static void hexpireGenericCommand(client *c, const char *cmd, long long basetime
|
|||
}
|
||||
expire += basetime;
|
||||
|
||||
/* Adjust the expiration time to match the configured precision reduction.
|
||||
* This optimizes the aggregation of keys into buckets of `ebucetks` down
|
||||
* to ~seconds, ~minutes, ~hours, etc, rather than msec resolution */
|
||||
if (server.hash_field_expiry_bits) {
|
||||
uint64_t tmp = (1 << server.hash_field_expiry_bits)-1;
|
||||
expire = (expire + tmp) & ~tmp;
|
||||
|
||||
/* Check expire overflow after rounding */
|
||||
if (expire > (long long) EB_EXPIRE_TIME_MAX) {
|
||||
addReplyErrorExpireTime(c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read optional flag [NX|XX|GT|LT] */
|
||||
char *optArg = c->argv[3]->ptr;
|
||||
if (!strcasecmp(optArg, "nx")) {
|
||||
|
|
Loading…
Reference in New Issue