# INFO

> Server information and statistics in Redis-compatible sections, for monitoring and troubleshooting.

URL: https://docs.hotkv.com/commands/info/

```
INFO [section [section ...]]
```

- Group: Server
- Complexity: O(1), or O(N) for sections that walk clients or databases
- HotKV Cloud: all plans
- On-Premise: no license needed

`INFO` returns the server's state and statistics as text: sections that
start with a `# Name` line, each followed by `field:value` lines. The
sections and field names follow Redis, so monitoring agents, exporters and
dashboards built for Redis read HotKV without changes.

## Sections

Without arguments, `INFO` returns the default sections. Name one or more
sections (case-insensitive) to get only those. Unknown names are ignored.

| Section | Contents | In `default` |
| --- | --- | --- |
| `server` | Version, mode, OS, process id, port, uptime, config file. | Yes |
| `clients` | Connected, blocked, Pub/Sub and watching clients; largest buffers. | Yes |
| `memory` | Memory used, peak, resident size, `maxmemory` and policy, script memory. | Yes |
| `persistence` | Snapshot and append-only file status and statistics. | Yes |
| `stats` | Connections, commands, network bytes, hits and misses, expiry and eviction, ACL denials. | Yes |
| `replication` | Role, primary link or connected replicas, replication offsets and backlog. | Yes |
| `cpu` | CPU time used by the server process. | Yes |
| `modules` | Always empty: HotKV has no modules. | Yes |
| `errorstats` | Error replies counted by error code. | Yes |
| `cluster` | `cluster_enabled`. | Yes |
| `keyspace` | Keys, keys with a TTL, average TTL per database. | Yes |
| `commandstats` | Calls, time and failures per command. | No |
| `latencystats` | Latency percentiles per command. | No |
| `cluster_info` | The same fields as [CLUSTER INFO](https://docs.hotkv.com/commands/cluster-info/index.md); empty without cluster mode. | No |
| `latency` | HotKV only: latency percentiles over all commands together. | No |

You can also ask for these groups: `default`; `all`, which is every section
above except `latency`; and `everything`, which is all of them.

## Fields you will use most

**server**: `redis_version` (the Redis version HotKV is compatible with,
`8.4.0`, which client libraries check), `hotkv_version` (the HotKV release),
`redis_mode` (`standalone` or `cluster`), `os`, `process_id`, `run_id`,
`tcp_port`, `uptime_in_seconds`, `uptime_in_days`, `hz`, `executable`,
`config_file`, and one `listener<n>` line per kind of listener (`tcp`,
`tls`) with its addresses and port.

**clients**: `connected_clients`, `maxclients`, `blocked_clients`,
`pubsub_clients`, `watching_clients`, `total_watched_keys`,
`total_blocking_keys`, `client_recent_max_input_buffer`,
`client_recent_max_output_buffer`, `tracking_clients` (connections with
[client-side caching](https://docs.hotkv.com/develop/client-side-caching/index.md) tracking on).

**memory**: `used_memory` and `used_memory_human`, `used_memory_rss`,
`used_memory_peak`, `used_memory_peak_perc`, `used_memory_dataset`,
`used_memory_overhead`, `total_system_memory`, `maxmemory`,
`maxmemory_policy`, `mem_fragmentation_ratio` (resident size divided by
memory in use), `used_memory_lua`, `used_memory_scripts`,
`number_of_cached_scripts`, `number_of_functions`, `number_of_libraries`,
`mem_replication_backlog`, `mem_clients_normal`, `mem_clients_slaves`
(what the clients, and the replicas' links, hold; see
[Client memory](https://docs.hotkv.com/operate/memory-and-eviction/index.md#client-memory)),
`mem_not_counted_for_evict` (memory `maxmemory` leaves out: what replicas that lag
hold beyond the backlog, and the AOF buffers), `mem_aof_buffer`, and the
`mem_cluster_*` fields, among them `mem_cluster_slot_migration_input_buffer` and
`mem_cluster_slot_migration_input_buffer_peak` (the writes a migration target keeps
while the copy arrives, see [Scaling a cluster](https://docs.hotkv.com/clustering/scaling/index.md#writes-made-during-the-copy)).

**persistence**: `rdb_changes_since_last_save`, `rdb_bgsave_in_progress`,
`rdb_last_save_time`, `rdb_last_bgsave_status`, `rdb_saves`,
`aof_enabled`, `aof_rewrite_in_progress`, `aof_last_bgrewrite_status`,
`aof_last_write_status`, and with the append-only file on,
`aof_current_size` and `aof_base_size`. `loading` is always `0`.

**stats**: `total_connections_received`, `total_commands_processed`,
`instantaneous_ops_per_sec`, `total_net_input_bytes`,
`total_net_output_bytes`, `instantaneous_input_kbps`,
`instantaneous_output_kbps`, `rejected_connections`, `sync_full`,
`sync_partial_ok`, `sync_partial_err`, `expired_keys`, `expired_subkeys`,
`evicted_keys`, `evicted_clients` (clients closed by
[`maxmemory-clients`](https://docs.hotkv.com/reference/configuration/index.md#maxmemory-clients)),
`keyspace_hits`, `keyspace_misses`, `pubsub_channels`,
`pubsub_patterns`, `total_error_replies`, `total_forks` and `latest_fork_usec`
(child processes the server started), the `tracking_total_keys`,
`tracking_total_items` and `tracking_total_prefixes` of
[client-side caching](https://docs.hotkv.com/develop/client-side-caching/index.md#how-many-keys-the-server-remembers),
`client_query_buffer_limit_disconnections`,
`client_output_buffer_limit_disconnections`, and the
`acl_access_denied_auth`, `_cmd`, `_key` and `_channel` counters.

**replication**: `role` (`master` or `slave`, as Redis reports it). On a
replica: `master_host`, `master_port`, `master_link_status` (`up` or
`down`), `master_last_io_seconds_ago`, `master_sync_in_progress`,
`slave_repl_offset`. On a primary: `connected_slaves` and one
`slave<n>:ip=...,port=...,state=...,offset=...,lag=...` line per replica.
Both: `master_replid`, `master_repl_offset`, `repl_backlog_active`,
`repl_backlog_size`.

**cpu**: `used_cpu_sys`, `used_cpu_user`, `used_cpu_sys_children`,
`used_cpu_user_children`, in seconds.

**keyspace**: one line per database that has keys, such as
`db0:keys=1520,expires=12,avg_ttl=34012,subexpiry=0`. `avg_ttl` is in
milliseconds; `subexpiry` counts keys with field-level expiry.

**commandstats**: `cmdstat_<command>:calls=...,usec=...,usec_per_call=...,rejected_calls=...,failed_calls=...`.

**errorstats**: `errorstat_<CODE>:count=...`, for example
`errorstat_WRONGTYPE:count=3`.

**latencystats**: `latency_percentiles_usec_<command>:p50=...,p99=...,p99.9=...`,
with the percentiles set by `latency-tracking-info-percentiles`, while
`latency-tracking` is `yes` (the default).

**latency** (HotKV only): `latency_p50`, `latency_p99`, `latency_p999` in
microseconds over every command, and `latency_samples`.

Fields for Redis features that HotKV does not have are present for
compatibility and read `0`.

## Return value

The text, with `\r\n` line endings and an empty line between sections: a
bulk string in RESP2, a verbatim string (`txt`) in RESP3. Asking only for
unknown sections returns an empty string.

## Examples

```
127.0.0.1:6379> INFO keyspace
# Keyspace
db0:keys=1520,expires=12,avg_ttl=34012,subexpiry=0
db3:keys=8,expires=0,avg_ttl=0,subexpiry=0
127.0.0.1:6379> INFO server clients
# Server
redis_version:8.4.0
hotkv_version:<version>
...
redis_mode:standalone
...
uptime_in_seconds:86400
...

# Clients
connected_clients:12
...
```

## Compatibility

Same section names, order and field names as Redis 7.4, so tools that parse
Redis's `INFO` work unchanged. Differences: `redis_version` is the
compatibility level and `hotkv_version` holds the real version; the
`cluster_info` section follows Valkey; the `latency` section and the
`everything` group are HotKV additions; and fields for features HotKV does
not have read `0`.

## See also

[CONFIG RESETSTAT](https://docs.hotkv.com/commands/config-resetstat/index.md), [MEMORY STATS](https://docs.hotkv.com/commands/memory-stats/index.md),
[CLIENT LIST](https://docs.hotkv.com/commands/client-list/index.md), [LATENCY](https://docs.hotkv.com/commands/latency/index.md),
[ROLE](https://docs.hotkv.com/commands/role/index.md), [monitoring](https://docs.hotkv.com/operate/monitoring/index.md)