Skip to content

Commit

Permalink
REDIS_DBCRON_DBS_PER_SEC -> REDIS_DBCRON_DBS_PER_CALL
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Mar 11, 2013
1 parent 13f8484 commit da2dd89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/redis.c
Expand Up @@ -618,7 +618,7 @@ void updateDictResizePolicy(void) {
* it will get more aggressive to avoid that too much memory is used by
* 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. */
void activeExpireCycle(void) {
static unsigned int current_db = 0;
Expand All @@ -632,7 +632,7 @@ void activeExpireCycle(void) {
timelimit = 1000000*REDIS_EXPIRELOOKUPS_TIME_PERC/server.hz/100;
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;
redisDb *db = server.db+(current_db % server.dbnum);

Expand Down Expand Up @@ -815,14 +815,14 @@ void databasesCron(void) {
unsigned int j;

/* 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);
resize_db++;
}

/* Rehash */
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);
rehash_db++;
if (work_done) {
Expand Down
2 changes: 1 addition & 1 deletion src/redis.h
Expand Up @@ -76,7 +76,7 @@
#define REDIS_CONFIGLINE_MAX 1024
#define REDIS_EXPIRELOOKUPS_PER_CRON 10 /* lookup 10 expires per loop */
#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_SHARED_SELECT_CMDS 10
#define REDIS_SHARED_INTEGERS 10000
Expand Down

0 comments on commit da2dd89

Please sign in to comment.