activeExpireCycle() smarter with many DBs and under expire pressure.
activeExpireCycle() smarter with many DBs and under expire pressure.

activeExpireCycle() tries to test just a few DBs per iteration so that
it scales if there are many configured DBs in the Redis instance.
However this commit makes it a bit smarter when one a few of those DBs
are under expiration pressure and there are many many keys to expire.

What we do is to remember if in the last iteration had to return because
we ran out of time. In that case the next iteration we'll test all the
configured DBs so that we are sure we'll test again the DB under
pressure.

Before of this commit after some mass-expire in a given DB the function
tested just a few of the next DBs, possibly empty, a few per iteration,
so it took a long time for the function to reach again the DB under
pressure. This resulted in a lot of memory being used by already expired
keys and never accessed by clients.

slfs007/mk-redis,tzq668766/redis-3.0-annotated,arijitvt/redis,jingjidejuren/redis,gechong/redis-3.0-annotated,spinlock/redis,huangz1990/redis-3.0-annotated,gilala/redis,tellapart/redis,saisai/redis,weizijun/redis,mingyaaaa/redis,alenslan/redis,YuanZhewei/redis,xujunhai1991/redis,xujunhai1991/redis,yuhc/redis-benchmark-enhanced,devaos/redis,Aliceljm1/redis,mumingv/redis-3.0-annotated,ttuna/msot-redis,gilala/hredis,citusdata/redis,mcanthony/redis,SyntaxStacks/redis,PradheepShrinivasan/redis,simplestbest/redis,soveran/redis,YuraLukashik/redis,yybirdcf/learn-redis,twskipper/redis,itugs/redis,moonbingbing/redis-3.0-annotated,YuraLukashik/redis,fankeke/redis-3.0-annotated,mattsta/redis,zczhuohuo/redis,sunlianqiang/redis-3.0-annotated,ton31337/redis,MSOpenTech/redis,j0hnma/szredis,ttuna/msot-redis,MasahikoSawada/redis,shshlzh/redis-3.0-annotated,atreeyang/redis,josiahcarlson/redis,jackyan/redis,duanx/redis,netroby/redis,pmem/redis,brg-liuwei/redis,mpalmer/redis,honestme/redis,Hailei/redis,moonbingbing/redis-3.0-annotated,shreesundara/redis,francischan714/redis,0x20h/redis,j0hnma/szredis,4396/redis,saisai/redis,mattsta/redis,rrsean/redis-3.0-annotated,mengzhejin/RedisStudy,mgk/redis,hornen/redis,rogerchina/redis,universsky/redis,holstvoogd/redis,elkingtonmcb/redis,YuanZhewei/redis,idning/redis,whille/redis-3.0-annotated,gilala/hredis,neomantra/redis,a-pavlov/redis,h0x91b/redis,Wangyao14cyy/redis,spinlock/redis,mgk/redis,sunheehnus/redis,nnog/redis,valdsJohn/redis,hedisdb/hedis,slfs007/mk-redis,netroby/redis,itamarhaber/redis,davidradunz/redis,itamarhaber/redis,splitice/redis,wbailey5/redis,rrsean/redis-3.0-annotated,SummonY/redis,xuguruogu/redis,brg-liuwei/redis,gilala/hbjredis,mengyou0304/redis,davidradunz/redis,jacklee0810/redis-3.0-annotated,linfangrong/redis,hawkchch/redis,iandyh/redis,universsky/redis,190235047/redis,wangyikai/redis,zy416548283/redis-3.0-annotated,GrimDerp/redis,zhiliaoniu/redis,healerkx/redis,miaoyc1989/redis-3.0-annotated,wprice/redis,flashbuckets/redis,Soledad89/redis,buobao/redis-3.0-annotated,PKRoma/redis,Sciumo/redis,onlymellb/redis-3.0-annotated,huangz1990/experiment-redis,mverrilli/redis,MOON-CLJ/redis,gechong/redis-3.0-annotated,mengyou0304/redis,YuraLukashik/redis,vincent-vivian-liu/redis,dayuoba/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,cloudrain21/redis,blackmady/redis,Aliceljm1/redis-3.0-annotated,ouyangkongtong/redis,MSOpenTech/redis,cnbin/redis,JoeWoo/redis,kaushik94/redis,izhoujie/redis,Hailei/redis,SummonY/redis,hedisdb/hedis,huyuezheng/redis,rrsean/redis-3.0-annotated,xuguruogu/redis,CodeJuan/redis,MSOpenTech/redis,yuzhangjob/redis-3.0-annotated-unstable,louisliangjun/redis,janekmi/redis,takeshineshiro/redis,shshlzh/redis-3.0-annotated,tzq668766/redis-3.0-annotated,charsyam/redis,weizijun/redis,arijitvt/redis,charsyam/redis,jbochi/parallel_redis,zhoudayang/redis,roth1002/redis,himoca/redis,programmecat/redis,yossigo/redis,mverrilli/redis,alenslan/redis,ouyangkongtong/redis,mengyou0304/redis,darksideofthemoo/redis-histogram,rogerlz/redis,jbochi/redis,abhiklodh/redis,gaoxianglong/redis,wangyikai/redis,ituncle/redis,haima-zju/redis-3.0-annotated,SyntaxStacks/redis,francischan714/redis,OmarQunsul/graph-redis,pietern/redis,francischan714/redis,twskipper/redis,NBSW/redis,devaos/redis,ofirluzon/redis,wprice/redis,AALEKH/redis,zguangyu/redis,universsky/redis,hawkchch/redis,mverrilli/redis,itugs/redis,Aliceljm1/redis,tellapart/redis,gilala/redis,ReadCode/redis-3.0-annotated,splitice/redis,j0hnma/szredis,YuraLukashik/redis,HeartSaVioR/redis,ituncle/redis,citusdata/redis,moonbingbing/redis-3.0-annotated,WorkingOfTimtohyZhang/redis-3.0-annotated,taoguan/redis,ofirluzon/redis,timothyohare/3rdPartySrc-redis,csuhawk/redis,kensou97/redis,ErikDubbelboer/redis,StevenTsai/redis,netroby/redis,nilyang/redis-tdd-annotation,rogerlz/redis,JoeWoo/redis,cloudrain21/redis,badboy/redis,tellapart/redis,taoguan/redis,tjschuck/redis,ReadCode/redis-3.0-annotated,blackmady/redis,YongMan/redis,mengzhejin/RedisStudy,clamoriniere1A/redis,jxwr/redis,msn217/redis-3.0-annotated,z-fork/redis,charsyam/redis,arijitvt/redis,AplayER/redis,splitice/redis,Aliceljm1/redis-3.0-annotated,GrimDerp/redis,jackyan/redis,duanx/redis,Aaron1992/redis,gilala/hredis,honestme/redis,huangz1990/redis-3.0-annotated,linfangrong/redis,wuyu201321060203/redis-3.0-annotated,pedigree/redis,pcarrier/redis,himoca/redis,StevenTsai/redis,badboy/redis,itamarhaber/redis,shshlzh/redis-3.0-annotated,honestme/redis,takeshineshiro/redis,OmarQunsul/graph-redis,4396/redis,narma/redis,dongqifan2/redis-3.0-annotated,elkingtonmcb/redis,CodeJuan/redis,PradheepShrinivasan/redis,holstvoogd/redis,allengaller/redis,zhiliaoniu/redis,wujf/redis,roth1002/redis,clamoriniere1A/redis,xlzhan/redis,mcanthony/redis,oranagra/redis,Soledad89/redis,seandsky/redis,j0hnma/szredis,maodeyi/redis_lua,modulexcite/redis,dongqifan2/redis-3.0-annotated,itamarhaber/redis,Markgorden/redis,tjschuck/redis,blackmady/redis,nuxeh/redis,modulexcite/redis,sunheehnus/redis,onlymellb/redis-3.0-annotated,yuhc/redis-benchmark-enhanced,kaushik94/redis,ramonsnir/redis,Sciumo/redis,xuzhezhaozhao/redis_reading,ipmobiletech/redis,zhoudayang/redis,190235047/redis,spinlock/redis,miaoyc1989/redis-3.0-annotated,jackyan/redis,MSOpenTech/redis,whille/redis-3.0-annotated,zczhuohuo/redis,qiyang0221/redis,HeartSaVioR/redis,janekmi/redis,programmecat/redis,unasm/redis-3.0-annotated,atreeyang/redis,healerkx/redis,takeshineshiro/redis,fankeke/redis-3.0-annotated,fengshao0907/redis-3.0-annotated,mpalmer/redis,clamoriniere1A/redis,tanghaodong25/redis,hgl888/redis,jacklee0810/redis-3.0-annotated,wenxueliu/redis_comment,ytjiang/redis,hornen/redis,atreeyang/redis,itugs/redis,HeartSaVioR/redis,ncopa/redis,dreamquster/redis,maodeyi/redis_lua,timothyohare/3rdPartySrc-redis,arijitvt/redis,HunanTV/redis,darksideofthemoo/redis-histogram,ofirluzon/redis,zhaobo1023/redis-3.0-annotated,idning/redis,ksarch-saas/redis,CodeJuan/redis,190235047/redis,mingyaaaa/redis,takeshineshiro/redis,ErikDubbelboer/redis,huangz1990/experiment-redis,nnog/redis,splitice/redis,YuanZhewei/redis,seandsky/redis,wangyikai/redis,tanghaodong25/redis,sunheehnus/redis,yossigo/redis,gongice/redis-3.0-annotated,mgk/redis,linfangrong/redis,LongXQ/redis,dreamquster/redis,nnog/redis,soloestoy/redis,wenxueliu/redis_comment,hornen/redis,neomantra/redis,yuhc/redis-benchmark-enhanced,blackmady/redis,mpalmer/redis,rogerchina/redis,yuzhangjob/redis-3.0-annotated-unstable,linfangrong/redis,idning/redis,pcarrier/redis,mengyou0304/redis,darksideofthemoo/redis-histogram,zguangyu/redis,supasate/redis,allengaller/redis,csuhawk/redis,jasonkying/redis,janekmi/redis,mattsta/redis,mingyaaaa/redis,supasate/redis,oranagra/redis,Sciumo/redis,RepmujNetsik/redis,nnog/redis,yybirdcf/learn-redis,izhoujie/redis,pkdevbox/redis,huangz1990/redis-3.0-annotated,josiahcarlson/redis,mingyaaaa/redis,pedigree/redis,JoeWoo/redis,SyntaxStacks/redis,ketor/redis,flashbuckets/redis,Soledad89/redis,rogerchina/redis,a-pavlov/redis,hgl888/redis,allengaller/redis,drinkthere/redis-3.0-annotated,wbailey5/redis,zhoudayang/redis,josiahcarlson/redis,PKRoma/redis,abhiklodh/redis,shshlzh/redis-3.0-annotated,kmiku7/redis,Wangyao14cyy/redis,xuzhezhaozhao/redis_reading,jxwr/redis,abhiklodh/redis,taoguan/redis,jasonkying/redis,allengaller/redis,MSOpenTech/redis,NBSW/redis,ouyangkongtong/redis,simplestbest/redis,holstvoogd/redis,wujf/redis,valdsJohn/redis,onlymellb/redis-3.0-annotated,haima-zju/redis-3.0-annotated,wenxueliu/redis_comment,soveran/redis,antirez/redis,AALEKH/redis,mumingv/redis,whille/redis-3.0-annotated,csuhawk/redis,unasm/redis-3.0-annotated,sunlianqiang/redis-3.0-annotated,seppo0010/redis,weizijun/redis,mgk/redis,seppo0010/rlite-server,alenslan/redis,iandyh/redis,NBSW/redis,colstrom/redis,pcarrier/redis,himoca/redis,francischan714/redis,tjschuck/redis,rogerchina/redis,harrisonfeng/redis,z-fork/redis,kaushik94/redis,OmarQunsul/graph-redis,guker/redis,duanx/redis,GitHubMota/redis,slfs007/mk-redis,YongMan/redis,spearhead-ea/redis,NBSW/redis,nilyang/redis-tdd-annotation,Markgorden/redis,colstrom/redis,spinlock/redis,harrisonfeng/redis,ytjiang/redis,yossigo/redis,wujf/redis,mpalmer/redis,healerkx/redis,gilala/redis,z-fork/redis,davidradunz/redis,HunanTV/redis,huyuezheng/redis,mcanthony/redis,ErikDubbelboer/redis,JoeWoo/redis,july2993/redis,valdsJohn/redis,rouzier/redis,shining-yang/redis,HeartSaVioR/redis,harrisonfeng/redis,soveran/redis,LongXQ/redis,xuzhezhaozhao/redis_reading,Markgorden/redis,gaoxianglong/redis,mverrilli/redis,jasonkying/redis,gilala/bjredis,ttuna/msot-redis,ttuna/msot-redis,tjschuck/redis,nilyang/redis-tdd-annotation,shreesundara/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,badboy/redis,gongice/redis-3.0-annotated,hawkchch/redis,shreesundara/redis,shining-yang/redis,july2993/redis,seppo0010/redis,zguangyu/redis,GitHubMota/redis,ramonsnir/redis,cnbin/redis,YuanZhewei/redis,xlzhan/redis,zhiliaoniu/redis,ttuna/msot-redis,charsyam/redis,cusspvz/redis,jackyan/redis,tzq668766/redis-3.0-annotated,ksarch-saas/redis,adamweixuan/redis-3.0-annotated,programmecat/redis,ofirluzon/redis,jacklee0810/redis-3.0-annotated,AALEKH/redis,ituncle/redis,elkingtonmcb/redis,pmem/redis,rouzier/redis,jingjidejuren/redis,oranagra/redis,tellapart/redis,h0x91b/redis,wbailey5/redis,vincent-vivian-liu/redis,pmem/redis,brg-liuwei/redis,ksarch-saas/redis,Wangyao14cyy/redis,fengshao0907/redis,soloestoy/redis,wbailey5/redis,dongqifan2/redis-3.0-annotated,ketor/redis,StevenTsai/redis,ofirluzon/redis,ReadCode/redis-3.0-annotated,dayuoba/redis,aim-for-better/redis,SyntaxStacks/redis,ipmobiletech/redis,aim-for-better/redis,ytjiang/redis,gaoxianglong/redis,wuyu201321060203/redis-3.0-annotated,neomantra/redis,guker/redis,zhcy/redis,buobao/redis-3.0-annotated,Aaron1992/redis,july2993/redis,mumingv/redis,hgl888/redis,fengshao0907/redis,a-pavlov/redis,MasahikoSawada/redis,nuxeh/redis,nuxeh/redis,jingjidejuren/redis,PKRoma/redis,saisai/redis,soloestoy/redis,cloudrain21/redis,ton31337/redis,seandsky/redis,qiyang0221/redis,seppo0010/redis,riyan8250/redis,jbochi/redis,0x55/redis-3.0-annotated,RepmujNetsik/redis,zczhuohuo/redis,h0x91b/redis,citusdata/redis,mumingv/redis-3.0-annotated,mumingv/redis,xujunhai1991/redis,riyan8250/redis,weizijun/redis,yuzhangjob/redis-3.0-annotated-unstable,ncopa/redis,thomasdarimont/redis,roth1002/redis,j0hnma/hszredis,neomantra/redis,pkdevbox/redis,nilyang/redis-tdd-annotation,h0x91b/redis,OmarQunsul/graph-redis,gilala/hbjredis,HunanTV/redis,gilala/redis,GrimDerp/redis,YongMan/redis,magastzheng/redis-3.0-annotated,GitHubMota/redis,yossigo/redis,zhaobo1023/redis-3.0-annotated,soloestoy/redis,unasm/redis-3.0-annotated,ituncle/redis,gaoxianglong/redis,gilala/bjredis,0x55/redis-3.0-annotated,antirez/redis,StevenTsai/redis,spearhead-ea/redis,vincent-vivian-liu/redis,zy416548283/redis-3.0-annotated,seppo0010/rlite-server,4396/redis,Aliceljm1/redis,timothyohare/3rdPartySrc-redis,valdsJohn/redis,xuguruogu/redis,yossigo/redis,soveran/redis,tanghaodong25/redis,ytjiang/redis,LongXQ/redis,pedigree/redis,ton31337/redis,zhaobo1023/redis-3.0-annotated,fengshao0907/redis,spearhead-ea/redis,a-pavlov/redis,antirez/redis,MOON-CLJ/redis,ErikDubbelboer/redis,Aliceljm1/redis,ctripcorp/redis,4396/redis,z-fork/redis,louisliangjun/redis,MasahikoSawada/redis,wuyu201321060203/redis-3.0-annotated,roth1002/redis,gilala/bjredis,xlzhan/redis,yybirdcf/learn-redis,vincent-vivian-liu/redis,pkdevbox/redis,mengzhejin/RedisStudy,j0hnma/hszredis,universsky/redis,cusspvz/redis,devaos/redis,adamweixuan/redis-3.0-annotated,antirez/redis,AplayER/redis,supasate/redis,yybirdcf/learn-redis,AplayER/redis,Sciumo/redis,zhcy/redis,saisai/redis,0x55/redis-3.0-annotated,Markgorden/redis,healerkx/redis,thomasdarimont/redis,adamweixuan/redis-3.0-annotated,badboy/redis,honestme/redis,flashbuckets/redis,seandsky/redis,modulexcite/redis,pcarrier/redis,ipmobiletech/redis,magastzheng/redis-3.0-annotated,pietern/redis,narma/redis,ctripcorp/redis,seppo0010/rlite-server,buobao/redis-3.0-annotated,neomantra/redis,cusspvz/redis,kmiku7/redis,darksideofthemoo/redis-histogram,guker/redis,RepmujNetsik/redis,fengshao0907/redis,cusspvz/redis,PKRoma/redis,wenxueliu/redis_comment,pkdevbox/redis,gilala/bjredis,0x20h/redis,pietern/redis,kensou97/redis,PKRoma/redis,drinkthere/redis-3.0-annotated,RepmujNetsik/redis,Hailei/redis,xlzhan/redis,abhiklodh/redis,twskipper/redis,shining-yang/redis,rogerlz/redis,timothyohare/3rdPartySrc-redis,guker/redis,gilala/hbjredis,gechong/redis-3.0-annotated,HouKangkang/redis-3.0-annotated,hedisdb/hedis,atreeyang/redis,izhoujie/redis,magastzheng/redis-3.0-annotated,qiyang0221/redis,hornen/redis,zy416548283/redis-3.0-annotated,oranagra/redis,HouKangkang/redis-3.0-annotated,fankeke/redis-3.0-annotated,Wangyao14cyy/redis,rouzier/redis,thomasdarimont/redis,holstvoogd/redis,ramonsnir/redis,maodeyi/redis_lua,thomasdarimont/redis,qiyang0221/redis,pmem/redis,ketor/redis,louisliangjun/redis,twskipper/redis,wuyu201321060203/redis-3.0-annotated,taoguan/redis,pedigree/redis,ncopa/redis,charsyam/redis,flashbuckets/redis,rogerlz/redis,oranagra/redis,dayuoba/redis,MOON-CLJ/redis,shreesundara/redis,citusdata/redis,wangyikai/redis,ouyangkongtong/redis,xuzhezhaozhao/redis_reading,colstrom/redis,harrisonfeng/redis,0x55/redis-3.0-annotated,dreamquster/redis,programmecat/redis,cnbin/redis,aim-for-better/redis,fengshao0907/redis-3.0-annotated,j0hnma/hszredis,SummonY/redis,yuhc/redis-benchmark-enhanced,modulexcite/redis,dayuoba/redis,louisliangjun/redis,kensou97/redis,zhiliaoniu/redis,colstrom/redis,ncopa/redis,riyan8250/redis,Hailei/redis,ksarch-saas/redis,izhoujie/redis,brg-liuwei/redis,0x20h/redis,gongice/redis-3.0-annotated,narma/redis,YongMan/redis,pietern/redis,huyuezheng/redis,seppo0010/redis,simplestbest/redis,cloudrain21/redis,tanghaodong25/redis,ton31337/redis,jasonkying/redis,GitHubMota/redis,jbochi/parallel_redis,iandyh/redis,dreamquster/redis,alenslan/redis,zhcy/redis,MasahikoSawada/redis,HouKangkang/redis-3.0-annotated,sunheehnus/redis,nuxeh/redis,sunlianqiang/redis-3.0-annotated,kmiku7/redis,ipmobiletech/redis,PradheepShrinivasan/redis,gilala/hredis,supasate/redis,seppo0010/rlite-server,aim-for-better/redis,Aaron1992/redis,elkingtonmcb/redis,jbochi/redis,zguangyu/redis,netroby/redis,cnbin/redis,miaoyc1989/redis-3.0-annotated,PradheepShrinivasan/redis,jxwr/redis,janekmi/redis,CodeJuan/redis,drinkthere/redis-3.0-annotated,mumingv/redis,Aaron1992/redis,simplestbest/redis,Aliceljm1/redis-3.0-annotated,xuguruogu/redis,zhoudayang/redis,itugs/redis,hawkchch/redis,gilala/hbjredis,july2993/redis,hedisdb/hedis,fengshao0907/redis-3.0-annotated,190235047/redis,zhcy/redis,clamoriniere1A/redis,wujf/redis,Soledad89/redis,GrimDerp/redis,mengzhejin/RedisStudy,duanx/redis,kensou97/redis,soloestoy/redis,LongXQ/redis,iandyh/redis,huyuezheng/redis,ctripcorp/redis,mumingv/redis-3.0-annotated,rouzier/redis,AALEKH/redis,devaos/redis,davidradunz/redis,zczhuohuo/redis,mcanthony/redis,idning/redis,miaoyc1989/redis-3.0-annotated,kmiku7/redis,msn217/redis-3.0-annotated,haima-zju/redis-3.0-annotated,HunanTV/redis,wprice/redis,AplayER/redis,kaushik94/redis,csuhawk/redis,jingjidejuren/redis,xujunhai1991/redis,wprice/redis,hgl888/redis,shining-yang/redis,SummonY/redis,0x20h/redis,ctripcorp/redis,jbochi/parallel_redis,j0hnma/hszredis,huangz1990/experiment-redis,huangz1990/experiment-redis,msn217/redis-3.0-annotated,josiahcarlson/redis,riyan8250/redis