Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
5f185413
Commit
5f185413
authored
Nov 17, 2014
by
antirez
Browse files
RSS aware maxmemory: enforced/adjusted == maxmemory on config changes.
parent
2a11e94f
Changes
2
Show whitespace changes
Inline
Side-by-side
src/config.c
View file @
5f185413
...
...
@@ -226,6 +226,8 @@ void loadServerConfigFromString(char *config) {
}
} else if (!strcasecmp(argv[0],"maxmemory") && argc == 2) {
server.maxmemory = memtoll(argv[1],NULL);
server.maxmemory_adjusted = server.maxmemory;
server.maxmemory_enforced = server.maxmemory;
} else if (!strcasecmp(argv[0],"rss-aware-maxmemory") && argc==2) {
if ((server.rss_aware_maxmemory = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
...
...
@@ -635,6 +637,8 @@ void configSetCommand(redisClient *c) {
if (getLongLongFromObject(o,&ll) == REDIS_ERR ||
ll < 0) goto badfmt;
server.maxmemory = ll;
server.maxmemory_adjusted = ll;
server.maxmemory_enforced = ll;
if (server.maxmemory) {
if (server.maxmemory < zmalloc_used_memory()) {
redisLog(REDIS_WARNING,"WARNING: the new maxmemory value set via CONFIG SET is smaller than the current memory usage. This will result in keys eviction and/or inability to accept new write commands depending on the maxmemory-policy.");
...
...
src/redis.c
View file @
5f185413
...
...
@@ -1433,11 +1433,11 @@ void initServerConfig(void) {
server.maxclients = REDIS_MAX_CLIENTS;
server.bpop_blocked_clients = 0;
server.maxmemory = REDIS_DEFAULT_MAXMEMORY;
server.maxmemory_enforced = REDIS_DEFAULT_MAXMEMORY;
server.maxmemory_adjusted = REDIS_DEFAULT_MAXMEMORY;
server.maxmemory_policy = REDIS_DEFAULT_MAXMEMORY_POLICY;
server.maxmemory_samples = REDIS_DEFAULT_MAXMEMORY_SAMPLES;
server.rss_aware_maxmemory = REDIS_DEFAULT_RSS_AWARE_MAXMEMORY;
server
.
maxmemory_enforced
=
0
;
server
.
maxmemory_adjusted
=
0
;
server.hash_max_ziplist_entries = REDIS_HASH_MAX_ZIPLIST_ENTRIES;
server.hash_max_ziplist_value = REDIS_HASH_MAX_ZIPLIST_VALUE;
server.list_max_ziplist_entries = REDIS_LIST_MAX_ZIPLIST_ENTRIES;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment