Only resize/rehash a few databases per cron iteration.

This is the first step to lower the CPU usage when many databases are
configured. The other is to also process a limited number of DBs per
call in the active expire cycle.
This commit is contained in:
antirez
2013-03-08 14:01:12 +01:00
parent aa7f74c7e9
commit a4bb4b29fb
2 changed files with 51 additions and 35 deletions

View File

@ -76,6 +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_MAX_WRITE_PER_EVENT (1024*64)
#define REDIS_SHARED_SELECT_CMDS 10
#define REDIS_SHARED_INTEGERS 10000