zoukankan      html  css  js  c++  java
  • Couchbase V(管理任务)

    Couchbase V(管理任务)

    多读写

    在Couchbase2.1中支持硬盘多读些(Multi- Readers and Writers),一般双核4G服务默认3个thread

    4核16G内存一个设置为 8个线程

    Server Warmup

    在Couchbase重启后,需要经历热身阶段才能进入运行状态:

    1. 初始化,这阶段服务没有任何数据,将从vBucket中加载初始化各个vBucket的状态和数据。

    2. Key Dump. 这阶段,主要加载key和metadata。

    3. 检查访问日志, 预读单个访问缓存日志(记录了key的频率),如果日志存在,就会先根据日志加载key,然后再从硬盘加载数据

    4. 加载key,后就会加载相关文档

    在达到下面状态时,服务进入运行状态:

    1. 完成加载所有访问日志key的文档 ,或

    2. 加载完所有的vBuckets的文档, 或

    3. 内存所有的文档大于等于 ep_warmup_min_items_threshold, 或

    4. RAM的百分比临近 ep_warmup_min_memory_threshold, 或

    5. RAM的使用临近 mem_low_wat

    如果服务在warmup状态, 客户端连接回报 ENGINE_TMPFAIL code 错误。

    获取 Warmup 信息

    使用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
    
    ep_warmup_thread
    Indicates if the warmup has completed. Returns "running" or "complete".
    
    ep_warmup_state

    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.
      

    修改 Warmup 的阈值

    通过 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个副本,是非常有用的

  • 相关阅读:
    模块化、结构化的代码,何尝不是在讲人生
    DOS操作文件或文件夹
    OSQL
    DOS 命令大全
    Red Tea
    SetInterval_1
    SetInterval
    分库分表——Sharding-Sphere
    线上redis热key问题
    线上redis bgsave导致服务响应延迟
  • 原文地址:https://www.cnblogs.com/nagi/p/4191404.html
Copyright © 2011-2022 走看看