Skip to main content

INFO sections

The INFO command returns information and statistics about the Apache Kvrocks™ server in a format that is simple to parse by computers and easy to read by humans.

The optional section parameter can be used to select a specific section of information in form INFO section section ...:

ParameterDesc
serverGeneral information about the Kvrocks server
clientsClient connections information
memoryMemory consumption related information
statsGeneral statistics
replicationMaster/replica replication information
cpuCPU consumption statistics
commandstatsKvrocks command statistics
clusterCluster section
keyspaceDatabase related statistics
rocksdbRocksDB related statistics

Return value

The return value of INFO command is bulk string: as a collection of text lines.

Lines can contain a section name (starting with a # character) or a property. All the properties are in the form of field:value terminated by an empty line.

Sample return value:

# Server
version:unstable
kvrocks_version:unstable
redis_version:4.0.0
git_sha1:0a2dcee
kvrocks_git_sha1:0a2dcee
os:Darwin 19.4.0 x86_64
gcc_version:4.2.1
arch_bits:64
process_id:1467
tcp_port:6666
uptime_in_seconds:8
uptime_in_days:0

# Clients
maxclients:10000
connected_clients:1
monitor_clients:0
blocked_clients:0

# Memory
used_memory_rss:19558400
used_memory_rss_human:18.65M
used_memory_lua:35840
used_memory_lua_human:35.00K
used_memory_startup:20357120

# Persistence
loading:0
bgsave_in_progress:0
last_bgsave_time:1689584510
last_bgsave_status:ok
last_bgsave_time_sec:0

# Stats
total_connections_received:1
total_commands_processed:2
instantaneous_ops_per_sec:0
total_net_input_bytes:23
total_net_output_bytes:8231
instantaneous_input_kbps:0
instantaneous_output_kbps:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
pubsub_channels:0
pubsub_patterns:0

# Replication
role:master
connected_slaves:0
master_repl_offset:0

# CPU
used_cpu_sys:0
used_cpu_user:0

# Commandstats
cmdstat_command:calls=1,usec=904,usec_per_call=904
cmdstat_info:calls=1,usec=0,usec_per_call=0

# Cluster
cluster_enabled:0

# Keyspace
# Last scan db time: Thu Jan 1 08:00:00 1970
db0:keys=0,expires=0,avg_ttl=0,expired=0
sequence:0
used_db_size:0
max_db_size:0
used_percent: 0%
disk_capacity:499963174912
used_disk_size:266419978240
used_disk_percent: 53%

# RocksDB
estimate_keys[default]:0
block_cache_usage[default]:0
block_cache_pinned_usage[default]:0
index_and_filter_cache_usage[default]:0
level0_file_limit_slowdown[default]:
level0_file_limit_stop[default]:
pending_compaction_bytes_slowdown[default]:
pending_compaction_bytes_stop[default]:
memtable_count_limit_slowdown[default]:
memtable_count_limit_stop[default]:
estimate_keys[metadata]:0
block_cache_usage[metadata]:0
block_cache_pinned_usage[metadata]:0
index_and_filter_cache_usage[metadata]:0
level0_file_limit_slowdown[metadata]:
level0_file_limit_stop[metadata]:
pending_compaction_bytes_slowdown[metadata]:
pending_compaction_bytes_stop[metadata]:
memtable_count_limit_slowdown[metadata]:
memtable_count_limit_stop[metadata]:
estimate_keys[zset_score]:0
block_cache_usage[zset_score]:0
block_cache_pinned_usage[zset_score]:0
index_and_filter_cache_usage[zset_score]:0
level0_file_limit_slowdown[zset_score]:
level0_file_limit_stop[zset_score]:
pending_compaction_bytes_slowdown[zset_score]:
pending_compaction_bytes_stop[zset_score]:
memtable_count_limit_slowdown[zset_score]:
memtable_count_limit_stop[zset_score]:
estimate_keys[pubsub]:0
block_cache_usage[pubsub]:0
block_cache_pinned_usage[pubsub]:0
index_and_filter_cache_usage[pubsub]:0
level0_file_limit_slowdown[pubsub]:
level0_file_limit_stop[pubsub]:
pending_compaction_bytes_slowdown[pubsub]:
pending_compaction_bytes_stop[pubsub]:
memtable_count_limit_slowdown[pubsub]:
memtable_count_limit_stop[pubsub]:
estimate_keys[propagate]:0
block_cache_usage[propagate]:0
block_cache_pinned_usage[propagate]:0
index_and_filter_cache_usage[propagate]:0
level0_file_limit_slowdown[propagate]:
level0_file_limit_stop[propagate]:
pending_compaction_bytes_slowdown[propagate]:
pending_compaction_bytes_stop[propagate]:
memtable_count_limit_slowdown[propagate]:
memtable_count_limit_stop[propagate]:
estimate_keys[stream]:0
block_cache_usage[stream]:0
block_cache_pinned_usage[stream]:0
index_and_filter_cache_usage[stream]:0
level0_file_limit_slowdown[stream]:
level0_file_limit_stop[stream]:
pending_compaction_bytes_slowdown[stream]:
pending_compaction_bytes_stop[stream]:
memtable_count_limit_slowdown[stream]:
memtable_count_limit_stop[stream]:
all_mem_tables:3520
cur_mem_tables:3520
snapshots:0
num_immutable_tables:0
num_running_flushes:0
memtable_flush_pending:0
compaction_pending:0
num_running_compactions:0
num_live_versions:5
num_super_version:5
num_background_errors:0
flush_count:0
compaction_count:0
put_per_sec:0
get_per_sec:0
seek_per_sec:0
next_per_sec:0
prev_per_sec:0
is_bgsaving:no
is_compacting:no

Server section

Here is the meaning of all fields in the server section:

PropertyDesc
versionVersion of the Kvrocks server
kvrocks_versionVersion of the Kvrocks server
redis_versionVersion of the compatible Redis server
git_sha1Git SHA1
kvrocks_git_sha1Git SHA1
osOperating system hosting the Kvrocks server
arch_bitsArchitecture (32 or 64 bits)
gcc_versionVersion of the GCC compiler used to compile the Kvrocks server
clang_versionVersion of the Clang compiler used to compile the Kvrocks server
process_idPID of the server process
tcp_portTCP/IP listen port
uptime_in_secondsNumber of seconds since Kvrocks server start
uptime_in_daysSame value expressed in days

Clients section

Here is the meaning of all fields in the clients section:

PropertyDesc
maxclientsThe value of the maxclients configuration directive
connected_clientsNumber of client connections (excluding connections from replicas)
monitor_clientsNumber of monitor client connections
blocked_clientsNumber of blocked client connections

Memory section

Here is the meaning of all fields in the memory section:

PropertyDesc
used_memory_rssNumber of bytes that Kvrocks allocated as seen by the operating system (a.k.a resident set size). This is the number reported by tools such as top(1) and ps(1).
used_memory_rss_humanHuman-readable representation of previous value
used_memory_luaNumber of bytes used by the Lua engine
used_memory_lua_humanHuman-readable representation of previous value
used_memory_startupInitial amount of memory consumed by Kvrocks at startup in bytes

Stats section

Here is the meaning of all fields in the stats section:

PropertyDesc
total_connections_receivedTotal number of connections accepted by the server
total_commands_processedTotal number of commands processed by the server
instantaneous_ops_per_secNumber of commands processed per second
total_net_input_bytesThe total number of bytes read from the network
total_net_output_bytesThe total number of bytes written to the network
instantaneous_input_kbpsThe network's read rate per second in KB/sec
instantaneous_output_kbpsThe network's write rate per second in KB/sec
sync_fullThe number of full resyncs with replicas
sync_partial_okThe number of accepted partial resync requests
sync_partial_errThe number of denied partial resync requests
pubsub_channelsGlobal number of pub/sub channels with client subscriptions
pubsub_patternsGlobal number of pub/sub pattern with client subscriptions

CommandStats section

The commandstats section provides statistics based on the command type, including the number of calls that reached command execution, the total CPU time consumed by these commands, the average CPU consumed per command execution.

For each command type, the following line is added:

cmdstat_XXX:calls=XXX,usec=XXX,usec_per_call=XXX

Persistence section

Here is the meaning of all fields in the replication section:

PropertyDesc
loadingFlag indicating if the restore of the backup is on-going
bgsave_in_progressWhether the bgsave was in-progress
last_bgsave_timeThe last timestamp that bgsave command was executed
last_bgsave_statusWhether the bgsave was ok or not (ok/err)
last_bgsave_time_secThe bgsave command elapsed seconds

Replication section

Here is the meaning of all fields in the replication section:

PropertyDesc
roleValue is "master" if the instance is replica of no one, or "slave" if the instance is a replica of some master instance. Note that a replica can be master of another replica (chained replication).
master_repl_offsetThe server's current replication offset

If the instance is a replica, these additional fields are provided:

PropertyDesc
master_hostHost or IP address of the master
master_portMaster listening TCP port
master_link_statusStatus of the link (up/down)
master_sync_unrecoverable_errorMaster sync unrecoverable error (yes/no)
master_last_io_seconds_agoNumber of seconds since the last interaction with master
master_sync_in_progressIndicate the master is syncing to the replica
slave_repl_offsetThe replication offset of the replica instance
slave_priorityThe priority of the instance as a candidate for failover

CPU section

Here is the meaning of all fields in the cpu section:

PropertyDesc
used_cpu_sysSystem CPU consumed by the Kvrocks server, which is the sum of system CPU consumed by all threads of the server process (main thread and background threads)
used_cpu_userUser CPU consumed by the Kvrocks server, which is the sum of user CPU consumed by all threads of the server process (main thread and background threads)

Cluster section

Here is the meaning of all fields in the cluster section:

PropertyDesc
cluster_enabledIndicate Kvrocks cluster is enabled

Keyspace section

The keyspace section provides statistics on the main dictionary of each database. The statistics are the number of keys, and the number of keys with an expiration. Note that Kvrocks only have db0 and keys statistics wasn't manipulated in memory, so we need to use the dbsize scan to async scan and calculate the keys number like below:

# Last scan db time: Sun Oct 31 17:13:14 2021
db0:keys=0,expires=0,avg_ttl=0,expired=0

The line starts with # means the last scan was executed on Oct 31 17:13:14 2021.

PropertyDesc
sequenceThe sequence number of the RocksDB
used_db_sizeThe total disk size used by Kvrocks(NOT included the WAL)
max_db_sizeMax disk size can be used by Kvrocks, 0 means unlimited.
used_percentPercent representation of used_db_size/max_db_size.
disk_capacityThe capacity of the disk.
used_disk_sizeTotal used size of the disk(NOT Kvrocks used disk size).
used_disk_percentPercent representation of used_disk_size/disk_capacity.

RocksDB section

Here is the meaning of all fields in the rocksdb section:

The rocksdb section provides statistics on each RocksDB column family and all fields were exported by RocksDB, if the field was not explained clearly enough, you can also see more information on the RocksDB wiki.

There are five column families on kvrocks:

Column FamilyDesc
defaultUsed to store the subkeys of the complex data structure like hash/set/list/zset/geo.
metadataUsed to store the metadata of the complex data structure and string.
zset_scoreUsed to store the mapping of zset's score to member, which would make the range by score operation faster.
pubsubUsed to propagate the pubsub message to replicas.
propagateUsed to propagate other commands to replicas except pubsub message.
streamUsed to store the data of the stream type.

... and below statistics were column family related:

PropertyDesc
estimate_keys[xxx]Estimate keys in the column family, may contains the tombstone and expired keys, it's a fast way to know how many keys on the column family but not precise.
block_cache_usage[xxx]Total block cache bytes used by this column family.
block_cache_pinned_usage[xxx]Total pinned bytes in this column family.
index_and_filter_cache_usage[xxx]Total bytes was used to cache the index and filter block.
level0_file_limit_slowdown[xxx]Number of IO write stalls caused by reaching the level0 file slowdown limit.
level0_file_limit_stop[xxx]Number of IO write stalls caused by reaching the level0 file stop limit.
pending_compaction_bytes_slowdown[xxx]Number of IO write stalls caused reaching the pending compaction bytes slowdown limit.
pending_compaction_bytes_stop[xxx]Number of IO write stalls caused reaching the pending compaction bytes stop limit.
memtable_count_limit_slowdown[xxx]Number of IO write stalls caused by reaching the memtable count slowdown limit.
memtable_count_limit_stop[xxx]Number of IO write stalls caused by reaching the memtable count stop limit.

... those statistics were the entire rocksdb side:

PropertyDesc
all_mem_tablesApproximate size of active, unflushed immutable, and pinned immutable memtables in bytes.
cur_mem_tablesApproximate size of active and unflushed immutable memtable in bytes.
snapshotsNumber of snapshots in rocksdb.
num_immutable_tablesNumber of the immutable.
num_running_flushesNumber of currently running flushes.
memtable_flush_pendingThis metric returns 1 if a memtable flush is pending; otherwise it returns 0.
compaction_pendingThis metric returns 1 if at least one compaction is pending; otherwise, the metric reports 0.
num_running_compactionsNumber of currently running compactions.
num_live_versionsNumber of live versions. More live versions often mean more SST files are held from being deleted, by iterators or unfinished compactions.
num_super_versionNumber of the super version inside the RocksDB.
num_background_errorsAccumulated number of background errors.
flush_countNumber of flushes.
compaction_countNumber of compactions.
put_per_secNumber of put processed per second.
get_per_secNumber of get processed per second.
seek_per_secNumber of seek processed per second.
next_per_secNumber of next processed per second.
prev_per_secNumber of prev processed per second.
is_bgsavingThis metric returns 1 if the bgsave was running; otherwise it returns 0.
is_compactingThis metric returns 1 if the compaction was running; otherwise it returns 0.