????Redis???
????redis?????key-value?洢??????Memcached??????????洢??value??????????????string(?????)??list(????)??set(????)??zset(sorted set --??????)??hash??????????????Щ????????????push/pop??add/remove?????????????????????????????????Щ????????????????????????redis???????????????????memcached??????????Ч???????????????????С????????redis????????????μ?????д???????????????д??????????????????????????????master-slave(????)?????Redis???????linux????????????????????????windows??????????????????
????Redis????
??????????????bench-mark?????
?????????????50?????????100000??????
???????ú???????????256??????????
????Linux box??????Linux 2.6??????X3320 Xeon 2.5 ghz??
?????????????loopback???(127.0.0.1)??
???????:?????????110000??/s??д???????81000??/s ??
????Redis??windows???????????
????????????Redis????????
????Redis??????????
???????????????????????MasterRedis????У???????????Redis?????????У????????????
????redis.conf????Redis???????????????????????????????á?
??????????redis.conf????????ò????????壺
????daemonize?????????daemon???????
????pidfile??pid???λ??
????port???????????
????timeout??????????
????loglevel??log???????
????logfile??log???λ??
????databases????????????????
????save * *???????????????????*?????????????*?????ж????д????????????????????????????д????????????????????????????????
????rdbcompression???????????
????dbfilename????????????????????????????????????
????dir??????????????????????????
????appendonly???????appendonlylog???????????д??????????log????????????????????????????Ч???
????appendfsync??appendonlylog????????????????????????????д????????fsync????????????fsync????????fsync?????????????
????????????????????????????
1 daemonize  no
???????£?redis ???????????е???????????????У?????????????yes??
2 pidfile  /var/run/redis.pid
??Redis ???????е????Redis ?????pid ???????/var/run/redis.pid??????????????????????????ж??redis ??????????????????pid ???????
3 port
????????????6379
4 #bind 127.0.0.1
???Redis ????????????IP ???????????????????????????????????????????????????????????????????????????????
5 timeout 0
??????????????????????λ??????????????????????з????κ???????????????
6 tcp-keepalive 0
???TCP???????????????"???"?????server???????????0.???????
7 loglevel notice
log ??????4 ????debug??verbose?? notice?? ??warning?????????????????notice
8 logfile stdout
????log ????????????????????????????????????????????????????????
9 databases 16
??????????????????????SELECT ???????л????????????????????0??????16????
10
save 900 1
save 300 10
save 60 10000
?????????????????????????????dump.rdb????е?????????????"?????????????????????????"????snapshot??????涯??
??????????????
if(??60 ???????10000 ??keys ?????仯?){
???о?????
}else if(??300 ???????10 ??keys ??????仯){
???о?????
}else if(??900 ???????1 ??keys ??????仯){
???о?????
}
11 stop-writes-on-bgsave-error yes
?????????????????????????????й??????????????е?????write???????????"yes"???????????snapshot????????????????server????????????"no"????????snapshot?????????????snapshot????????????????????????????????????"??????????"
12 rdbcompression yes
????????????????????????rdb????????Σ?????yes?????????????????cpu????????????????Ч???Сrdb????????????洢/????/????/??????