You use the cbstats tool to get node- and cluster-level statistics about performance and items in storage. The tool can be found in the following locations, depending on your platform:
| Linux | /opt/couchbase/bin/cbstats |
| Windows | C:\Program Files\Couchbase\Server\bin\cbstats.exe |
| Mac OS X | /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/cbstats |
Be aware that this tool is a per-node, per-bucket operation. That means that if you want to perform this operation, you must specify the IP address of a node in the cluster and a named bucket. If you do not provided a named bucket, the server will apply the setting to any default bucket that exists at the specified node. If you want to perform this operation for an entire cluster, you will need to perform the command for every node/bucket combination that exists for that cluster.
You use this tool to get the couchbase node statistics. The general format for the command is:
shell> cbstats <IP>:11210 <command> -b <bucket_name> [-p <bucket_password>]
Where BUCKET_HOST is the hostname and port
(HOSTNAME[:PORT]) combination for a Couchbase
bucket, and username and
password are the authentication for the named
bucket.
COMMAND(and[options]) are
one of the follow options:
all allocator checkpoint [vbid] dispatcher [logs] hash [detail] items kvstore kvtimings raw argument reset slabs tap [username password] tapagg timings vkey keyname vbid
From these options, all and
timings will be the main ones you will use to
understand cluster or node performance. The other options are used
by Couchbase internally and to help resolve customer support
incidents.
For example, the cbstats output can be used
with other command-line tools to sort and filter the data.
shell> watch --diff "cbstats \ ip-10-12-19-81:11210 -b bucket1 -p password all | egrep 'item|mem|flusher|ep_queue|bg|eje|resi|warm'"
The following table provides a list of results that will be
returned when you perform a cbstats all
command:
| Stat | Description |
|---|---|
| ep_version | Version number of ep_engine. |
| ep_storage_age | Seconds since most recently stored object was initially queued. |
| ep_storage_age_highwat | ep_storage_age high water mark |
| ep_min_data_age | Minimum data age setting. |
| ep_startup_time | System-generated engine startup time |
| ep_queue_age_cap | Queue age cap setting. |
| ep_max_txn_size | Max number of updates per transaction. |
| ep_data_age | Seconds since most recently stored object was modified. |
| ep_data_age_highwat | ep_data_age high water mark |
| ep_too_young | Number of times an object was not stored due to being too young. |
| ep_too_old | Number of times an object was stored after being dirty too long. |
| ep_total_enqueued | Total number of items queued for persistence |
| ep_total_new_items | Total number of persisted new items. |
| ep_total_del_items | Total number of persisted deletions. |
| ep_total_persisted | Total number of items persisted. |
| ep_item_flush_failed | Number of times an item failed to flush due to storage errors. |
| ep_item_commit_failed | Number of times a transaction failed to commit due to storage errors. |
| ep_item_begin_failed | Number of times a transaction failed to start due to storage errors. |
| ep_expired_access | Number of times an item was expired on application access. |
| ep_expired_pager | Number of times an item was expired by ep engine item pager. |
| ep_item_flush_expired | Number of times an item is not flushed due to the expiry of the item |
| ep_queue_size | Number of items queued for storage. |
| ep_flusher_todo | Number of items remaining to be written. |
| ep_flusher_state | Current state of the flusher thread. |
| ep_commit_num | Total number of write commits. |
| ep_commit_time | Number of milliseconds of most recent commit |
| ep_commit_time_total | Cumulative milliseconds spent committing. |
| ep_vbucket_del | Number of vbucket deletion events. |
| ep_vbucket_del_fail | Number of failed vbucket deletion events. |
| ep_vbucket_del_max_walltime | Max wall time (µs) spent by deleting a vbucket |
| ep_vbucket_del_avg_walltime | Avg wall time (µs) spent by deleting a vbucket |
| ep_flush_duration_total | Cumulative seconds spent flushing. |
| ep_flush_all | True if disk flush_all is scheduled |
| ep_num_ops_get_meta | Number of getMeta operations |
| ep_num_ops_set_meta | Number of setWithMeta operations |
| ep_num_ops_del_meta | Number of delWithMeta operations |
| curr_items | Num items in active vbuckets (temp + live) |
| curr_temp_items | Num temp items in active vbuckets |
| curr_items_tot | Num current items including those not active (replica, dead and pending states) |
| ep_kv_size | Memory used to store item metadata, keys and values, no matter the vbucket’s state. If an item’s value is ejected, this stat will be decremented by the size of the item’s value. |
| ep_value_size | Memory used to store values for resident keys |
| ep_overhead | Extra memory used by transient data like persistence queues, replication queues, checkpoints, etc. |
| ep_max_data_size | Max amount of data allowed in memory. |
| ep_mem_low_wat | Low water mark for auto-evictions. |
| ep_mem_high_wat | High water mark for auto-evictions. |
| ep_total_cache_size | The total byte size of all items, no matter the vbucket’s state, no matter if an item’s value is ejected. |
| ep_oom_errors | Number of times unrecoverable OOMs happened while processing operations |
| ep_tmp_oom_errors | Number of times temporary OOMs happened while processing operations |
| ep_mem_tracker_enabled | True if memory usage tracker is enabled |
| ep_bg_fetched | Number of items fetched from disk. |
| ep_bg_meta_fetched | Number of meta items fetched from disk. |
| ep_bg_remaining_jobs | Number of remaining background fetch jobs. |
| ep_tap_bg_fetched | Number of tap disk fetches |
| ep_tap_bg_fetch_requeued | Number of times a tap background fetch task is re-queued. |
| ep_num_pager_runs | Number of times we ran pager loops to seek additional memory. |
| ep_num_expiry_pager_runs | Number of times we ran expiry pager loops to purge expired items from memory/disk |
| ep_num_access_scanner_runs | Number of times we ran access scanner to snapshot working set |
| ep_access_scanner_num_items | Number of items that last access scanner task swept to access log. |
| ep_access_scanner_task_time | Time of the next access scanner task (GMT) |
| ep_access_scanner_last_runtime | Number of seconds that last access scanner task took to complete. |
| ep_items_rm_from_checkpoints | Number of items removed from closed unreferenced checkpoints. |
| ep_num_value_ejects | Number of times item values got ejected from memory to disk |
| ep_num_eject_failures | Number of items that could not be ejected |
| ep_num_not_my_vbuckets | Number of times Not My VBucket exception happened during runtime |
| ep_tap_keepalive | Tap keep-alive time. |
| ep_dbname | DB path. |
| ep_dbinit | Number of seconds to initialize DB. |
| ep_io_num_read | Number of io read operations |
| ep_io_num_write | Number of io write operations |
| ep_io_read_bytes | Number of bytes read (key + values) |
| ep_io_write_bytes | Number of bytes written (key + values) |
| ep_pending_ops | Number of ops awaiting pending vbuckets |
| ep_pending_ops_total | Total blocked pending ops since reset |
| ep_pending_ops_max | Max ops seen awaiting 1 pending vbucket |
| ep_pending_ops_max_duration | Max time (µs) used waiting on pending vbuckets |
| ep_bg_num_samples | The number of samples included in the average |
| ep_bg_min_wait | The shortest time (µs) in the wait queue |
| ep_bg_max_wait | The longest time (µs) in the wait queue |
| ep_bg_wait_avg | The average wait time (µs) for an item before it is serviced by the dispatcher |
| ep_bg_min_load | The shortest load time (µs) |
| ep_bg_max_load | The longest load time (µs) |
| ep_bg_load_avg | The average time (µs) for an item to be loaded from the persistence layer |
| ep_num_non_resident | The number of non-resident items |
| ep_store_max_concurrency | Maximum allowed concurrency at the storage layer. |
| ep_store_max_readers | Maximum number of concurrent read-only storage threads. |
| ep_store_max_readwrite | Maximum number of concurrent read/write storage threads. |
| ep_bg_wait | The total elapse time for the wait queue |
| ep_bg_load | The total elapse time for items to be loaded from the persistence layer |
| ep_inconsistent_slave_chk | Flag indicating if we allow a “downstream” master to receive checkpoint messages |
| ep_mlog_compactor_runs | Number of times mutation log compactor is executed |
| ep_vb_total | Total vBuckets (count) |
| curr_items_tot | Total number of items |
| curr_items | Number of active items in memory |
| curr_temp_items | Number of temporary items in memory |
| vb_dead_num | Number of dead vBuckets |
| ep_diskqueue_items | Total items in disk queue |
| ep_diskqueue_memory | Total memory used in disk queue |
| ep_diskqueue_fill | Total enqueued items on disk queue |
| ep_diskqueue_drain | Total drained items on disk queue |
| ep_diskqueue_pending | Total bytes of pending writes |
| ep_vb_snapshot_total | Total VB state snapshots persisted in disk |
| vb_active_num | Number of active vBuckets |
| vb_active_curr_items | Number of in memory items |
| vb_active_num_non_resident | Number of non-resident items |
| vb_active_perc_mem_resident | % memory resident |
| vb_active_eject | Number of times item values got ejected |
| vb_active_expired | Number of times an item was expired |
| vb_active_ht_memory | Memory overhead of the hashtable |
| vb_active_itm_memory | Total item memory |
| vb_active_meta_data_memory | Total metadata memory |
| vb_active_ops_create | Number of create operations |
| vb_active_ops_update | Number of update operations |
| vb_active_ops_delete | Number of delete operations |
| vb_active_ops_reject | Number of rejected operations |
| vb_active_queue_size | Active items in disk queue |
| vb_active_queue_memory | Memory used for disk queue |
| vb_active_queue_age | Sum of disk queue item age in milliseconds |
| vb_active_queue_pending | Total bytes of pending writes |
| vb_active_queue_fill | Total enqueued items |
| vb_active_queue_drain | Total drained items |
| vb_active_num_ref_items | Number of referenced items |
| vb_active_num_ref_ejects | Number of times referenced item values got ejected |
| vb_pending_num | Number of pending vBuckets |
| vb_pending_curr_items | Number of in memory items |
| vb_pending_num_non_resident | Number of non-resident items |
| vb_pending_perc_mem_resident | % of memory used for resident items |
| vb_pending_eject | Number of times item values got ejected |
| vb_pending_expired | Number of times an item was expired |
| vb_pending_ht_memory | Memory overhead of the hashtable |
| vb_pending_itm_memory | Total item in memory |
| vb_pending_meta_data_memory | Total metadata memory |
| vb_pending_ops_create | Number of create operations |
| vb_pending_ops_update | Number of update operations |
| vb_pending_ops_delete | Number of delete operations |
| vb_pending_ops_reject | Number of rejected operations |
| vb_pending_queue_size | Pending items in disk queue |
| vb_pending_queue_memory | Memory used for disk queue |
| vb_pending_queue_age | Sum of disk queue item age in milliseconds |
| vb_pending_queue_pending | Total bytes of pending writes |
| vb_pending_queue_fill | Total enqueued items |
| vb_pending_queue_drain | Total drained items |
| vb_pending_num_ref_items | Number of referenced items |
| vb_pending_num_ref_ejects | Number of times referenced item values got ejected |