Membase provides statistics at multiple levels throughout the cluster. These are used for regular monitoring, capacity planning and to identify the performance characteristics of your cluster deployment. The most visible statistics are those in the Web UI, but components such as the REST interface, the proxy and individual nodes have directly accessible statistics interfaces.
REST Interface Statistics
The easiest to use interface into the statistics provided by REST is to use the Section 4.1, “Membase Administration Web Console” . This GUI gathers statistics via REST and displays them to your browser. The REST interface has a set of resources that provide access to the current and historic statistics the cluster gathers and stores. See the REST documentation for more information.
Detailed stats documentation can be found in the repository.
Along with stats at the REST and UI level, individual nodes can also be queried for statistics either through a client which uses binary protocol or through the stats utility shipped with membase.
For example:
$ /opt/membase/bin/ep_engine/management/stats localhost:11210 all
| auth_cmds: | 9 |
| auth_errors: | 0 |
| bucket_conns: | 10 |
| bytes_read: | 246378222 |
| bytes_written: | 289715944 |
| cas_badval: | 0 |
| cas_hits: | 0 |
| cas_misses: | 0 |
| cmd_flush: | 0 |
| cmd_get: | 134250 |
| cmd_set: | 115750 |
| ... |
The most commonly needed statistics are surfaced through the Web Console and have descriptions there and in the associated documentation. Software developers and system administrators wanting lower level information have it available through the stats interface.
There are 7 commands available through the stats interface:
stats (referred to as 'all') dispatcher hash tap timings vkey reset
stats
This displays a large list of statistics related to the Membase process including the underlying engine (ep_* stats).
This statistic will show what the dispatcher is currently doing:
dispatcher runtime: 45ms state: dispatcher_running status: running task: Running a flusher loop. nio_dispatcher state: dispatcher_running status: idle
The first entry, dispatcher, monitors the process responsible for disk access. The second entry is a non-IO (non disk) dispatcher. There may also be a ro_dispatcher dispatcher present if the engine is allowing concurrent reads and writes. When a task is actually running on a given dispatcher, the "runtime" tells you how long the current task has been running. Newer versions will show you a log of recently run dispatcher jobs so you can see what's been happening.
hash
tap
timings
vkey
reset
Membase Moxi Statistics
Membase Moxi, as part of it's support of memcached protocol, has support for the memcached 'stats' command. Regular memcached clients can request statistics through the memcached stats command. The stats command accepts optional arguments, and in the case of Moxi, there is a stats proxy sub-command. A detailed description of statistics available through Moxi can be found here.
For example, one simple client one may use is the commonly available netcat (output elided with ellipses):
$ echo "stats proxy" | nc localhost 11211 STAT basic:version 1.6.0 STAT basic:nthreads 5 ... STAT proxy_main:conf_type dynamic STAT proxy_main:behavior:cycle 0 STAT proxy_main:behavior:downstream_max 4 STAT proxy_main:behavior:downstream_conn_max 0 STAT proxy_main:behavior:downstream_weight 0 ... STAT proxy_main:stats:stat_configs 1 STAT proxy_main:stats:stat_config_fails 0 STAT proxy_main:stats:stat_proxy_starts 2 STAT proxy_main:stats:stat_proxy_start_fails 0 STAT proxy_main:stats:stat_proxy_existings 0 STAT proxy_main:stats:stat_proxy_shutdowns 0 STAT 11211:default:info:port 11211 STAT 11211:default:info:name default ... STAT 11211:default:behavior:downstream_protocol 8 STAT 11211:default:behavior:downstream_timeout 0 STAT 11211:default:behavior:wait_queue_timeout 0 STAT 11211:default:behavior:time_stats 0 STAT 11211:default:behavior:connect_max_errors 0 STAT 11211:default:behavior:connect_retry_interval 0 STAT 11211:default:behavior:front_cache_max 200 STAT 11211:default:behavior:front_cache_lifespan 0 STAT 11211:default:behavior:front_cache_spec STAT 11211:default:behavior:front_cache_unspec STAT 11211:default:behavior:key_stats_max 4000 STAT 11211:default:behavior:key_stats_lifespan 0 STAT 11211:default:behavior:key_stats_spec STAT 11211:default:behavior:key_stats_unspec STAT 11211:default:behavior:optimize_set STAT 11211:default:behavior:usr default ... STAT 11211:default:pstd_stats:num_upstream 1 STAT 11211:default:pstd_stats:tot_upstream 2 STAT 11211:default:pstd_stats:num_downstream_conn 1 STAT 11211:default:pstd_stats:tot_downstream_conn 1 STAT 11211:default:pstd_stats:tot_downstream_conn_acquired 1 STAT 11211:default:pstd_stats:tot_downstream_conn_released 1 STAT 11211:default:pstd_stats:tot_downstream_released 2 STAT 11211:default:pstd_stats:tot_downstream_reserved 1 STAT 11211:default:pstd_stats:tot_downstream_reserved_time 0 STAT 11211:default:pstd_stats:max_downstream_reserved_time 0 STAT 11211:default:pstd_stats:tot_downstream_freed 0 STAT 11211:default:pstd_stats:tot_downstream_quit_server 0 STAT 11211:default:pstd_stats:tot_downstream_max_reached 0 STAT 11211:default:pstd_stats:tot_downstream_create_failed 0 STAT 11211:default:pstd_stats:tot_downstream_connect 1 STAT 11211:default:pstd_stats:tot_downstream_connect_failed 0 STAT 11211:default:pstd_stats:tot_downstream_connect_timeout 0 STAT 11211:default:pstd_stats:tot_downstream_connect_interval 0 STAT 11211:default:pstd_stats:tot_downstream_connect_max_reached 0 ... END