1"""
2Default static values for performance module.
3Access by calling PerfDefaults.*
4DO NOT overwrite.
5"""
6from collections import namedtuple
7
8class PerfDefaults:
9
10    REB_MODE = namedtuple('REB_MODE', 'IN, OUT, SWAP')(0, 1, 2)
11
12    # general
13    batch                   =    50
14    kind                    =    "nonjson"
15    mem_quota               =    6000
16    threads_number          =    3          # mrw thread number, the name corresponds to ns_server setting
17    num_nodes               =    10
18    conf_file               =    "default.conf"
19    bucket                  =    "default"
20    strftime                =     "%b-%d-%Y_%H:%M:%S"
21    mc_threads              =    4
22    sched_delays            =    0
23    erlang_schedulers       =    ""
24    mem_high_wat            =    85          # percentage
25    mem_low_wat             =    75          # percentage
26    mutation_mem_threshold  =    95          # percentage, tmp oom threshold
27
28    # publish results to litmus dashboard
29    cbm                     =    0
30    cbm_host                =    "dashboard.hq.couchbase.com"
31    cbm_port                =    80
32
33    # load phase
34    items                   =    22000000    # 22 million
35    alog_hot_load           =    0           # run access log before hot load phase
36
37    # access phase
38    # Read:Insert:Update:Delete Ratio = 20:15:60:5.
39    ratio_sets              =    0.8
40    ratio_misses            =    0.05
41    ratio_creates           =    0.1875
42    ratio_deletes           =    0.0769
43    ratio_hot               =    0.05
44    ratio_hot_gets          =    0.995
45    ratio_hot_sets          =    0.995
46    ratio_expirations       =    0.025
47    max_creates             =    30000000    # 30 million
48    limit                   =    50
49
50    # cbstats collector
51    cb_stats                =    0
52    cb_stats_exc            =    "/opt/couchbase/bin/cbstats"
53    cb_stats_freq           =    1200        # collect cbstats every 20 minutes
54
55    # cbtop
56    cbtop_itv               =    20          # stats polling interval (seconds)
57    cbtop_dbhost            =    "127.0.0.1" # host where seriesly database is located
58    cbtop_dbslow            =    "slow"      # seriesly database to store slow changing data
59    cbtop_dbfast            =    "fast"      # seriesly database to store fast changing data
60    cbtop_dbevent           =    "event"     # seriesly database to store events
61
62    # rebalance
63    rebalance_after         =    200000
64    num_nodes_after         =    7           # num of nodes after rebalance.
65    reb_max_retries         =    0           # num of retries if rebalance fails
66    reb_cons_view           =    -1          # consistent view for rebalance task, 1: enable, 0: disable
67    reb_index_waiting       =    -1          # index wating for rebalance task, 1: enable, 0: disable
68    reb_no_fg               =    0           # rebalance without foreground load. 1: enable, 0: disable
69    reb_mode                =    REB_MODE.IN # rebalance mode
70
71    # control
72    avg_value_size          =    2048     # average size of document body
73    db_compaction           =    30       # db fragmentation percentage triggers compaction
74    ep_compaction           =    50       # ep_engine side fragmentation percentage which triggers compaction
75    hot_load_get            =    0        # fire gets instead of sets during hot load phase
76    hot_stack               =    0        # maintain a hot stack to queue up previously SETted keys
77    hot_stack_size          =    0        # size of the hot stack. 0: compute from hot-ratio * num-items (caution: in memory)
78    hot_stack_rotate        =    0        # rotate the stack upon eviction rather than pop the item. 1: enable, 0: disable
79    load_wait_until_drained =    1        # wait to be drained on the load phase, 1: enabled, 0: disabled
80    load_wait_until_repl    =    1        # wait for replication on the load phase, 1: enabled, 0: disabled
81    loop_wait_until_drained =    0        # wait to be drained on the access phase, 1: enabled, 0: disabled
82    loop_wait_until_repl    =    0        # wait for replication on the access phase, 1: enabled, 0: disabled
83    mcsoda_heartbeat        =    0        # health check heartbeat message for mcsoda. 0: no heartbeat, ~: in sec
84    mcsoda_max_ops_sec      =    0        # max ops per seconds for mcsoda
85    mcsoda_fg_stats_ops     =    1000     # fg ops threshold to persist latency stats
86    master_events           =    0        # print out master events after rebalance, 1: enabled, 0: disabled
87    num_value_samples       =    100      # number of value samples (in memory, use large number with caution)
88    nru_freq                =    1440     # NRU access scanner running freqency, in minutes
89    nru_wait                =    300      # time to wait for access scanner to finish, in seconds
90    nru_reb_delay           =    3600     # num of seconds to wait before triggering rebalance
91    nru_polling_freq        =    10       # frequency to poll access scanner running status, in seconds
92    nru_task                =    0        # schedule the NRU access scanner to run in the next hour, 1: enabled, 0: disabled
93    observe                 =    0        # measure observe latencies. 1: enabled, 0: disabled
94    obs_backoff             =    0.2      # default backoff time for observe commands, in seconds
95    obs_max_backoff         =    1        # max backoff time for observe commands, in seconds
96    obs_persist_count       =    1        # num of persisted copies to verify for observe commands
97    obs_repl_count          =    1        # num of replica copies to verify for observe commands
98    parallel_compaction     =    "false"  # process Database and View compaction in parallel. "true": enabled, "false": disabled
99    start_delay             =    0        # delay (seconds) to start access phase
100    tear_down               =    1        # 1: enabled, 0: disabled
101    tear_down_proxy         =    1        # (prerequsite: tear_down = 1) tear down proxy,  1: enabled, 0: disabled
102    tear_down_bucket        =    0        # (prerequsite: tear_down = 1) tear down bucket,  1: enabled, 0: disabled
103    tear_down_cluster       =    1        # (prerequsite: tear_down = 1) tear down server cluster, 1: enabled, 0: disabled
104    tear_down_on_setup      =    0        # teardown routine to clean up resources during startup. 1: enabled, 0: disabled
105    view_compaction         =    30       # view fragmentation percentage triggers compaction
106    vbuckets                =    1024     # number of vbuckets
107    warmup                  =    0        # restart memcached and measure warmup phase. 1: enabled, 0: disabled
108    woq_pattern             =    0        # measure standard write/observe/query pattern
109    woq_verbose             =    0        # verbose output for woq pattern
110    cor_pattern             =    0        # measure create/observe replication pattern on a different key space
111    cor_persist             =    0        # block until item has been persisted to disk, 1: enabled, 0: disabled
112    exp_pager_stime         =    3600     # expiry pager interval
113