在Couchbase2.1中支持硬盘多读些(Multi- Readers and Writers),通常双核4G服务默认3个threadnode
4核16G内存一个设置为 8个线程git
在Couchbase重启后,须要经历热身阶段才能进入运行状态:github
初始化,这阶段服务没有任何数据,将从vBucket中加载初始化各个vBucket的状态和数据。shell
Key Dump. 这阶段,主要加载key和metadata。缓存
检查访问日志, 预读单个访问缓存日志(记录了key的频率),若是日志存在,就会先根据日志加载key,而后再从硬盘加载数据线程
加载key,后就会加载相关文档日志
在达到下面状态时,服务进入运行状态:code
完成加载全部访问日志key的文档 ,或orm
加载完全部的vBuckets的文档, 或server
内存全部的文档大于等于 ep_warmup_min_items_threshold, 或
RAM的百分比临近 ep_warmup_min_memory_threshold, 或
RAM的使用临近 mem_low_wat
若是服务在warmup状态, 客户端链接回报 ENGINE_TMPFAIL code 错误。
使用cbstats获取warmup 信息,但一次只能获取一个节点一个bucket的信息:
shell> cbstats localhost:11210 -b beer_sample -p bucket_password all | grep 'warmup' shell> cbstats hostname:11210 -b my_bucket -p bucket_password raw warmup
Indicates if the warmup has completed. Returns "running" or "complete".
Indicates the current progress of the warmup:
Initial
Start warmup processes.
EstimateDatabaseItemCount
Estimating database item count.
KeyDump
Begin loading keys and metadata based, but not documents, into RAM.
CheckForAccessLog
Determine if an access log is available. This log indicates which keys have been frequently read or written.
LoadingAccessLog
Load information from access log.
LoadingData
This indicates the server is loading data first for keys listed in the access log, or if no log available, based on keys found during the 'Key Dump' phase.
Done
Server is ready to handle read and write requests.
经过 cbepctl 设定 ep_warmup_min_items_threshold 能够改变warmup的行。
服务默认天天2:00 AM UTC运行一次扫面访问日志,而决定key的使用频率:
# 每二十分钟扫描一次 shell> ./cbepctl localhost:11210 -b beer-sample set flush_param alog_sleep_time 20
每一个集群的node 都有两种数据 replica data and active data,replica data是其余节点的副本数据, active data是客户端写的数据。
Couchbase使用 p2p策略进行写副本, 而且只能调节写的速度。
一般设置3个副本,是很是有用的