mcstat

  • reference
    +
    The mcstat tool provides memory-related information for a specified bucket, or for all buckets on a cluster.

    Description

    The mcstat tool provides memory-related information for a specified bucket, or for all buckets on a cluster.

    The tool is located as follows:

    Platform Location

    Linux

    /opt/couchbase/bin/mcstats

    Windows

    C:\Program Files\Couchbase\Server\bin\mcstats.exe

    Mac OS X

    /Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/mcstats

    Syntax

    mcstat [options]

    The options are as follows:

    Options Description

    -h[=statkey]`or `--help[=statkey]

    Show the help message and exit. If =statkey is not specified, the common options for the command are listed. If =statkey is specified, the available statkeys for the command are listed instead.

    -h or --hostname, with the parameter <hostname[:port]> (for IPv4), or [address]:port (for IPv6)

    The name of the host (and optionally, the port number) to connect to. If no port number is specified, either a number specified with the -p option, is used, or the default 11210 is used.

    -p or --port <port>

    Optionally, the port number to connect to. If unspecified, the default 11210 is used.

    -b <bucketname>

    The bucket whose statistics are to be retrieved. If not specified, an error is returned, unless the -a option is specified.

    -a

    Return statistics for each bucket on the cluster.

    -u or --user <username>

    The username to be used in authentication. Must be specified, unless a certificate and key are provided.

    -P or --p <password>

    The password to be used in authentication. Must be specified, unless a certificate and key are provided.

    --tls[=<cert>,<key>]

    Optionally, authenticate by providing a certificate and key (instead of a username and password).

    -4 or --ipv4

    Connect over IPv4.

    -6 or --ipv6

    Connect over IPv6.

    -j or --json

    Print output as unformatted JSON.

    -J or --json=pretty

    Print output as formatted JSON.

    -I or --impersonate <username>

    Try to impersonate the specified user.

    --no-color

    Print output without color.

    [statkey]*

    Request one or more particular statistics. (Note that a list of available statistics can be returned with mcstat --help=statkey). If particular statistics are not specified, output is provided on all statistics.

    Example

    The following call returns statistical information for workload and audit, on the travel-sample bucket for host 10.144.231.101.

    ./mcstat -h 10.144.231.101 -u Administrator -P password -b travel-sample -J workload audit

    If successful, the command returns output as follows:

    {
    	"ep_workload:LowPrioQ_AuxIO:InQsize": 1,
    	"ep_workload:LowPrioQ_AuxIO:OutQsize": 0,
    	"ep_workload:LowPrioQ_NonIO:InQsize": 536,
    	"ep_workload:LowPrioQ_NonIO:OutQsize": 0,
    	"ep_workload:LowPrioQ_Reader:InQsize": 1,
    	"ep_workload:LowPrioQ_Reader:OutQsize": 0,
    	"ep_workload:LowPrioQ_Writer:InQsize": 2,
    	"ep_workload:LowPrioQ_Writer:OutQsize": 0,
    	"ep_workload:num_auxio": 2,
    	"ep_workload:num_nonio": 2,
    	"ep_workload:num_readers": 4,
    	"ep_workload:num_shards": 1,
    	"ep_workload:num_sleepers": 12,
    	"ep_workload:num_writers": 4,
    	"ep_workload:ready_tasks": 0
    }
    {
    	"dropped_events": 0,
    	"enabled": false
    }