Skip to content

You are viewing docs for an old version. Switch to latest v30.2.

Cluster Operations ​

Create Snapshot (for backups) ​

Creates a point-in-time snapshot of a Typesense node's state and data in the specified directory.

You can then backup the snapshot directory that gets created and later restore it as a data directory, as needed.

Sample Response ​

Definition ​

POST ${TYPESENSE_HOST}/operations/snapshot

Arguments ​

ParameterRequiredDescription
snapshot_pathyesThe directory on the server where the snapshot should be saved.

Re-elect Leader ​

Triggers a follower node to initiate the raft voting process, which triggers leader re-election.

The follower node that you run this operation against will become the new leader, once this command succeeds.

Sample Response ​

Definition ​

POST ${TYPESENSE_HOST}/operations/vote

Toggle Slow Request Log ​

Enable logging of requests that take over a defined threshold of time.

Default: -1 which disables slow request logging.

Slow requests are logged to the primary log file, with the prefix SLOW REQUEST.

Sample Response ​

Definition ​

POST ${TYPESENSE_HOST}/config

Cluster Metrics ​

Get current RAM, CPU, Disk & Network usage metrics.

Sample Response ​

Metrics Reference ​

System Metrics

MetricDescription
system_cpu_active_percentageOverall CPU usage across all cores.
system_cpuN_active_percentageCPU usage for individual core N (e.g. system_cpu1_active_percentage).
system_disk_total_bytesTotal disk space in bytes.
system_disk_used_bytesUsed disk space in bytes.
system_memory_total_bytesTotal system RAM in bytes.
system_memory_used_bytesUsed system RAM in bytes.
system_memory_total_swap_bytesTotal swap space in bytes.
system_memory_used_swap_bytesUsed swap space in bytes.
system_network_received_bytesNetwork bytes received.
system_network_sent_bytesNetwork bytes sent.

Typesense Memory Metrics

These metrics are sourced from jemalloc, the memory allocator used by Typesense.

MetricDescription
typesense_memory_allocated_bytesTotal bytes currently allocated by the Typesense process. This is the most direct measure of how much memory Typesense is actively using. Corresponds to jemalloc's stats.allocated.
typesense_memory_active_bytesTotal bytes in active memory pages allocated by the Typesense process. This is a multiple of the page size and is always >= allocated_bytes. Corresponds to jemalloc's stats.active.
typesense_memory_fragmentation_ratioFraction of active memory that is fragmented, calculated as 1 - (allocated_bytes / active_bytes). Values close to 0 indicate low fragmentation; higher values indicate more wasted space within active pages.
typesense_memory_mapped_bytesTotal bytes in virtual address space mapped by the allocator. Larger than active_bytes as it includes all mapped extents. Corresponds to jemalloc's stats.mapped.
typesense_memory_metadata_bytesBytes used by the memory allocator for its own internal bookkeeping and metadata structures. Corresponds to jemalloc's stats.metadata.
typesense_memory_resident_bytesTotal bytes physically resident in RAM. Includes metadata pages, active allocation pages, and unused dirty pages. Corresponds to jemalloc's stats.resident.
typesense_memory_retained_bytesTotal bytes in virtual memory mappings retained by the allocator rather than returned to the OS. This memory is not necessarily backed by physical RAM. Corresponds to jemalloc's stats.retained.

Definition ​

GET ${TYPESENSE_HOST}/metrics.json

API Stats ​

Get stats about API endpoints.

This endpoint returns average requests per second and latencies for all requests in the last 10 seconds.

Sample Response ​

Definition ​

GET ${TYPESENSE_HOST}/stats.json

Health ​

Get health information about a Typesense node.

Sample Response ​

Definition ​

GET ${TYPESENSE_HOST}/health

You are viewing docs for an old version. Switch to latest v30.2.