set flush_param

  • reference
    +
    The command set flush_param establishes bucket parameters for threading and memory management.

    Syntax

    The basic syntax is:

    cbepctl [host]:11210 -b [bucket-name] -u [administrator-name] -p [administrator-password] set flush_param [parameter] [value]

    The syntax to configure the access log settings is:

    cbepctl [hostname]:11210 -b [bucket-name] -u [administrator-name] -p [administrator-password] set flush_param alog_sleep_time [value]
    cbepctl [hostname]:11210 -b [bucket-name] -u [administrator-name] -p [administrator-password] set flush_param alog_task_time [value]

    The syntax for ejection is:

    cbepctl [host]:11210 -b [bucket-name] -u [administrator-name] -p [administrator-password] set flush_param [parameter] [value]

    Parameter used for changing ejection thresholds:

    • pager_active_vb_pcnt

    The syntax to set the out of memory threshold is:

    cbepctl [host]:11210 -b [bucket-name] -u [administrator-name] -p [administrator-password] set flush_param mutation_mem_threshold [value]

    Description

    Tune the dynamic shared thread pool performance by changing the thread types inside the ep-engine and memcached at run time. The command set flush_param adjusts the number of threads that prioritize read, write, non-i/o and auxiliary-i/o operations. These settings take effect immediately and do not require that the bucket be restarted.

    • The settings for threads number take effect only if the underlying operating system has a sufficient number of CPU cores. The minimum number of CPU cores is four (4), but three (3) additional cores are required for each additional writer thread. For example, five (5) writer threads is a valid setting if the underlying hardware has at least sixteen (16) cores.

    • Changes of thresholds are NOT persistent and must be reapplied after the bucket warmup.

    • The settings warmup_min_items_threshold, warmup_min_memory_threshold, exp_pager_stime, mem_high_wat, and mem_low_wat are removed, and no longer supported through cbepctl.

      These settings are replaced by new settings expiryPagerSleepTime, warmupBehavior, memoryLowWatermark, and memoryHighWatermark, which can be configured using REST APIs. See Creating and Editing Buckets.

    alog_sleep_time, alog_task_time

    Couchbase Server has an optimized disk warmup. An access scanner is periodically run, to determine which keys have been the most frequently used: typically, the scanner writes these key to an access log, which can be accessed by Couchbase Server at warmup, so that the corresponding documents can be loaded first. (See Initialization and Warmup for further information; including cases where item-residency is at very high levels, and in consequence, no access log is created or used.)

    The cbepctl flush_param command is used to change the initial time and the interval for the access scanner. For example, the initial time and interval might be changed to accommodate a peak time when an application needs these keys to be quickly available.

    By default, the access scanner runs once every 24 hours at 10:00 AM GMT. The scanner is highly CPU-intensive: therefore, to reduce the cluster-wide impact of running this task, its start time should be staggered to a different value on each node in the cluster. Note also that if the scanner runs at the same time that index updates are being made (either on the current node, or on one or more other nodes) by the Index Service, the performance of the index updates may be adversely affected. The scanner should be configured to minimize the likelihood of this problem.

    pager_active_vb_pcnt

    Ejection means that documents are removed from RAM but the key and metadata remain.

    Use pager_active_vb_pcnt settings to change the server thresholds for ejection.

    Do not change the ejection defaults unless required by Couchbase Support.
    mutation_mem_threshold

    By default, Couchbase Server sends clients a temporary out-of-memory error message if RAM is 95% consumed and only 5% RAM remains for overhead. Use the cbepctl set flush_param mutation_mem-threshold command parameter to change this threshold value.

    Do not change this default to a higher value. However, this value might be reduced if you need more RAM for system overhead such as disk queue or for server data structures.

    Options

    The following are the command options:

    Table 1. set flush_param options
    Option Description

    alog_sleep_time

    Access scanner interval (minute)

    alog_task_time

    Access scanner next task time (UTC)

    backfile_mem_threshold

    Memory threshold (%) on the current bucket quota before backfill task is made to back off.

    bg_fetch_delay

    Delay before executing a bg fetch (test feature).

    couch_response_timeout

    timeout in receiving a response from CouchDB.

    flushall_enabled

    Deprecated. Enable flush operation.

    pager_active_vb_pcnt

    Percentage of active vBuckets items among all ejected items by item pager.

    max_size

    Maximum memory used by the server.

    mutation_mem_threshold

    Amount of RAM that can be consumed in that caching layer before clients start receiving temporary out of memory messages.

    timing_log

    Path to log detailed timing stats.

    klog_compactor_queue_cap

    Queue cap to throttle the log compactor.

    klog_max_log_size

    Maximum size of a mutation log file allowed.

    klog_max_entry_ratio

    Max ratio of # of items logged to # of unique items.

    pager_unbiased_period

    Period after last access scanner run during which item pager preserve working set.

    queue_age_cap

    Maximum queue age before flushing data.

    max_txn_size

    Maximum number of items in a flusher transaction.

    min_data_age

    Minimum data age before flushing data.

    item_compressor_interval

    How often the item compressor task should be run, in milliseconds. Default value is 250.

    item_compressor_chunk_duration

    Maximum time, in milliseconds, for which the item compressor task is run, before being paused, and then resumed according to the established item_compressor_interval. Default value is 20.

    min_compression_ratio

    Minimum allowed ratio of each item’s uncompressed form to its compressed form. If the actual ratio is less than this value, the item is stored in uncompressed form. Default value is 1.2.

    % You must use the percentage sign in order to set the value by percentage.

    Examples

    Examples for setting the access scanner process

    To change the time interval when the access scanner process runs to every 20 minutes.

    cbepctl 10.5.2.117:11210 -b foo-bucket -u Administrator -p password \
    set flush_param alog_sleep_time 20

    To change the initial time that the access scanner process runs from the 2:00 AM UTC default to 11:00 PM UTC.

    cbepctl 10.5.2.117:11210 -b foo-bucket -u Administrator -p password \
    set flush_param alog_task_time 23

    This response shows the time interval changed to 20 minutes.

    setting param: alog_sleep_time 20
    set alog_sleep_time to 20

    This response shows the initial access scanner run time changed to 11:00 PM UTC.

    setting param: alog_task_time 23
    set alog_task_time to 23

    Examples for setting the out-of-memory error message

    In this example, the threshold is reduced to 65% of RAM.

    cbepctl 10.5.2.117:11210 -b foo-bucket -u Administrator -p password \
    set flush_param mutation_mem_threshold 65%

    The following example response shows the RAM threshold set to 65%.

    setting param: mutation_mem_threshold 65
    set mutation_mem_threshold to 65

    Examples for setting percentage of ejected items

    Based on the NRU algorithm, the server ejects active and replica data from a node. By default, the server is configured to 60% active items and 40% replica data from a node.

    The following example increases the percentage of active items that can be ejected from a node to 50%.

    cbepctl 10.5.2.117:11210 -b foo-bucket -u Administrator -p password \
    set flush_param pager_active_vb_pcnt 50

    Be aware of potential performance implications when changing the percentage of ejected items. It may be more desirable to eject as many replica items as possible and limit the amount of active data that can be ejected. By doing so, active data from a source node is maximized while maintaining incoming requests to that node. However, if the server is ejecting a very large percentage of replica data and a node fails, the replica data is not immediately available. In this case, the items are retrieved from disk and put back into RAM before the request is fulfilled.

    The following example response shows the percentage of ejected items being set.

    setting param: pager_active_vb_pcnt 50
    set pager_active_vb_pcnt to 50