Make prefetch configurable
Former-commit-id: 3b660347d70cc25d57119080bd43fb4671e36488
This commit is contained in:
parent
c92b90eb91
commit
aa64a260fc
@ -2535,6 +2535,7 @@ standardConfig configs[] = {
|
|||||||
createBoolConfig("use-fork", NULL, IMMUTABLE_CONFIG, cserver.fForkBgSave, 0, NULL, NULL),
|
createBoolConfig("use-fork", NULL, IMMUTABLE_CONFIG, cserver.fForkBgSave, 0, NULL, NULL),
|
||||||
createBoolConfig("allow-write-during-load", NULL, MODIFIABLE_CONFIG, g_pserver->fWriteDuringActiveLoad, 0, NULL, NULL),
|
createBoolConfig("allow-write-during-load", NULL, MODIFIABLE_CONFIG, g_pserver->fWriteDuringActiveLoad, 0, NULL, NULL),
|
||||||
createBoolConfig("io-threads-do-reads", NULL, IMMUTABLE_CONFIG, fDummy, 0, NULL, NULL),
|
createBoolConfig("io-threads-do-reads", NULL, IMMUTABLE_CONFIG, fDummy, 0, NULL, NULL),
|
||||||
|
createBoolConfig("prefetch-enabled", NULL, MODIFIABLE_CONFIG, g_pserver->prefetch_enabled, 1, NULL, NULL),
|
||||||
|
|
||||||
/* String Configs */
|
/* String Configs */
|
||||||
createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL),
|
createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL),
|
||||||
|
@ -2353,7 +2353,7 @@ void parseClientCommandBuffer(client *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t cqueries = c->vecqueuedcmd.size();
|
size_t cqueriesStart = c->vecqueuedcmd.size();
|
||||||
if (c->reqtype == PROTO_REQ_INLINE) {
|
if (c->reqtype == PROTO_REQ_INLINE) {
|
||||||
if (processInlineBuffer(c) != C_OK) break;
|
if (processInlineBuffer(c) != C_OK) break;
|
||||||
} else if (c->reqtype == PROTO_REQ_MULTIBULK) {
|
} else if (c->reqtype == PROTO_REQ_MULTIBULK) {
|
||||||
@ -2369,7 +2369,7 @@ void parseClientCommandBuffer(client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Prefetch outside the lock for better perf */
|
/* Prefetch outside the lock for better perf */
|
||||||
if (cqueries < c->vecqueuedcmd.size() && !GlobalLocksAcquired()) {
|
if (g_pserver->prefetch_enabled && cqueriesStart < c->vecqueuedcmd.size() && !GlobalLocksAcquired()) {
|
||||||
auto &query = c->vecqueuedcmd.back();
|
auto &query = c->vecqueuedcmd.back();
|
||||||
if (query.argc > 0 && query.argc == query.argcMax) {
|
if (query.argc > 0 && query.argc == query.argcMax) {
|
||||||
c->db->prefetchKeysAsync(c, query);
|
c->db->prefetchKeysAsync(c, query);
|
||||||
|
@ -2391,6 +2391,8 @@ struct redisServer {
|
|||||||
char *aof_rewrite_cpulist; /* cpu affinity list of aof rewrite process. */
|
char *aof_rewrite_cpulist; /* cpu affinity list of aof rewrite process. */
|
||||||
char *bgsave_cpulist; /* cpu affinity list of bgsave process. */
|
char *bgsave_cpulist; /* cpu affinity list of bgsave process. */
|
||||||
|
|
||||||
|
int prefetch_enabled = 1;
|
||||||
|
|
||||||
long long repl_batch_offStart = -1;
|
long long repl_batch_offStart = -1;
|
||||||
long long repl_batch_idxStart = -1;
|
long long repl_batch_idxStart = -1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user