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
da2dd899
Commit
da2dd899
authored
Mar 09, 2013
by
antirez
Browse files
REDIS_DBCRON_DBS_PER_SEC -> REDIS_DBCRON_DBS_PER_CALL
parent
13f84841
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
da2dd899
...
@@ -618,7 +618,7 @@ void updateDictResizePolicy(void) {
...
@@ -618,7 +618,7 @@ void updateDictResizePolicy(void) {
* it will get more aggressive to avoid that too much memory is used by
* it will get more aggressive to avoid that too much memory is used by
* keys that can be removed from the keyspace.
* keys that can be removed from the keyspace.
*
*
* No more than REDIS_DBCRON_DBS_PER_
SEC
databases are tested at every
* No more than REDIS_DBCRON_DBS_PER_
CALL
databases are tested at every
* iteration. */
* iteration. */
void activeExpireCycle(void) {
void activeExpireCycle(void) {
static unsigned int current_db = 0;
static unsigned int current_db = 0;
...
@@ -632,7 +632,7 @@ void activeExpireCycle(void) {
...
@@ -632,7 +632,7 @@ void activeExpireCycle(void) {
timelimit = 1000000*REDIS_EXPIRELOOKUPS_TIME_PERC/server.hz/100;
timelimit = 1000000*REDIS_EXPIRELOOKUPS_TIME_PERC/server.hz/100;
if (timelimit <= 0) timelimit = 1;
if (timelimit <= 0) timelimit = 1;
for (j = 0; j < REDIS_DBCRON_DBS_PER_
SEC
; j++) {
for (j = 0; j < REDIS_DBCRON_DBS_PER_
CALL
; j++) {
int expired;
int expired;
redisDb *db = server.db+(current_db % server.dbnum);
redisDb *db = server.db+(current_db % server.dbnum);
...
@@ -815,14 +815,14 @@ void databasesCron(void) {
...
@@ -815,14 +815,14 @@ void databasesCron(void) {
unsigned int j;
unsigned int j;
/* Resize */
/* Resize */
for (j = 0; j < REDIS_DBCRON_DBS_PER_
SEC
; j++) {
for (j = 0; j < REDIS_DBCRON_DBS_PER_
CALL
; j++) {
tryResizeHashTables(resize_db % server.dbnum);
tryResizeHashTables(resize_db % server.dbnum);
resize_db++;
resize_db++;
}
}
/* Rehash */
/* Rehash */
if (server.activerehashing) {
if (server.activerehashing) {
for (j = 0; j < REDIS_DBCRON_DBS_PER_
SEC
; j++) {
for (j = 0; j < REDIS_DBCRON_DBS_PER_
CALL
; j++) {
int work_done = incrementallyRehash(rehash_db % server.dbnum);
int work_done = incrementallyRehash(rehash_db % server.dbnum);
rehash_db++;
rehash_db++;
if (work_done) {
if (work_done) {
...
...
src/redis.h
View file @
da2dd899
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
#define REDIS_CONFIGLINE_MAX 1024
#define REDIS_CONFIGLINE_MAX 1024
#define REDIS_EXPIRELOOKUPS_PER_CRON 10
/* lookup 10 expires per loop */
#define REDIS_EXPIRELOOKUPS_PER_CRON 10
/* lookup 10 expires per loop */
#define REDIS_EXPIRELOOKUPS_TIME_PERC 25
/* CPU max % for keys collection */
#define REDIS_EXPIRELOOKUPS_TIME_PERC 25
/* CPU max % for keys collection */
#define REDIS_DBCRON_DBS_PER_
SEC
16
#define REDIS_DBCRON_DBS_PER_
CALL
16
#define REDIS_MAX_WRITE_PER_EVENT (1024*64)
#define REDIS_MAX_WRITE_PER_EVENT (1024*64)
#define REDIS_SHARED_SELECT_CMDS 10
#define REDIS_SHARED_SELECT_CMDS 10
#define REDIS_SHARED_INTEGERS 10000
#define REDIS_SHARED_INTEGERS 10000
...
...
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