Observability·7 min read·

Scaling Metrics Storage with VictoriaMetrics: 10x Compression Over Prometheus

Deploy single-node VictoriaMetrics on Ubuntu to store years of high-resolution Prometheus metrics with sub-second queries and minimal disk usage.

NB

Netbay Cloud Team

Netbay Engineering

On this page

Prometheus is the undisputed standard for Kubernetes and Linux metrics collection. However, its built-in time-series database (TSDB) is fundamentally designed for short-term operational monitoring (typically 15 to 30 days). Retaining months or years of high-cardinality metrics in Prometheus consumes hundreds of gigabytes of disk space, burdens CPU during compactions, and causes out-of-memory crashes during wide-range queries.

VictoriaMetrics is an open-source, high-efficiency time-series database designed as a drop-in replacement or long-term remote storage backend for Prometheus. It delivers over 10x compression (often storing samples in under 1 byte each), handles millions of unique time series, and supports the complete PromQL syntax via its extended MetricsQL engine.

Architectural Efficiency: Why VictoriaMetrics Outperforms Standard TSDBs

Prometheus local storage organizes samples in two-hour blocks containing chunk files, index files, and tombstones. When querying multi-month ranges, Prometheus must open thousands of individual index files, causing intense disk random IO and high memory consumption.

VictoriaMetrics replaces this with an LSM-tree (Log-Structured Merge-tree) inspired storage architecture:

  • Data is organized into parts containing sorted timestamps and values.
  • Values are compressed using Gorilla XOR floating-point compression, while timestamps are encoded using DoubleDelta.
  • Strings and labels are interned into a global dictionary, preventing duplicate label allocations.
  • Disk writes are purely sequential, maximizing the IOPS efficiency of High-Speed SSD storage in Lucknow DC01.

Installing VictoriaMetrics Single-Node on Ubuntu 24.04

For small to medium workloads (up to 1 million samples per second), the single-node binary of VictoriaMetrics is radically simpler to operate than distributed clusters like Thanos or Cortex:

bash
# Download and install VictoriaMetrics single-node binary
sudo apt-get update
sudo apt-get install -y curl

VM_VERSION="v1.102.0"
curl -fsSL -O "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/${VM_VERSION}/victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz"
sudo tar -xzf "victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz" -C /usr/local/bin
sudo chmod +x /usr/local/bin/victoria-metrics-prod
rm "victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz"

# Create system user and data storage directory
sudo useradd -r -s /usr/sbin/nologin victoriametrics
sudo mkdir -p /var/lib/victoria-metrics-data
sudo chown -R victoriametrics:victoriametrics /var/lib/victoria-metrics-data

Create a dedicated systemd service unit /etc/systemd/system/victoriametrics.service:

ini
# /etc/systemd/system/victoriametrics.service
[Unit]
Description=VictoriaMetrics Long-Term Time Series Database
After=network.target

[Service]
Type=simple
User=victoriametrics
Group=victoriametrics
ExecStart=/usr/local/bin/victoria-metrics-prod   -storageDataPath=/var/lib/victoria-metrics-data   -retentionPeriod=12m   -httpListenAddr=10.0.0.4:8428   -search.maxUniqueTimeseries=1000000   -dedup.minScrapeInterval=10s
Restart=always
RestartSec=3s
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

The flag -retentionPeriod=12m retains 12 months of high-resolution metric samples, while -dedup.minScrapeInterval=10s automatically deduplicates overlapping samples received from redundant scrapers.

bash
sudo systemctl daemon-reload
sudo systemctl enable --now victoriametrics
sudo systemctl status victoriametrics
Expand
VictoriaMetrics Storage
VictoriaMetrics Long-Term Time Series Compression

Streaming Metrics from Prometheus via remote_write

Configure your existing Prometheus instances to stream metrics to VictoriaMetrics using Prometheus's native remote_write protocol:

yaml
# /etc/prometheus/prometheus.yml
global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: "node-exporter"
    static_configs:
      - targets: ["localhost:9100"]

remote_write:
  - url: "http://10.0.0.4:8428/api/v1/write"
    queue_config:
      max_samples_per_send: 10000
      capacity: 20000
      max_shards: 4

Reload Prometheus to begin streaming:

bash
curl -X POST http://localhost:9090/-/reload

Prometheus now requires only 24 hours of local retention, offloading long-term storage to VictoriaMetrics on High-Speed SSD storage in Lucknow DC01.

VictoriaMetrics 10x Storage Compression Flow Prometheus Scrapers - Local retention: 2 hours - Low RAM requirements - remote_write stream - Snappy compressed Zero compaction stalls VictoriaMetrics Engine - Block LSM architecture - DoubleDelta + ZSTD - < 0.8 bytes per sample - 12-month retention Intel Xeon Platinum Grafana Dashboards - MetricsQL compatibility - Sub-second yearly graphs - Downsampling support - High-Speed SSD reads Lucknow DC01 VictoriaMetrics slashes TSDB disk usage by over 90% compared to native Prometheus
High-Performance Time-Series Database Architecture and Scaling
YouTube

Non-Blocking Snapshots and Backups

Unlike Prometheus, which requires complex volume freezing during backups, VictoriaMetrics supports instant non-blocking snapshots via HTTP:

bash
# Create an instant snapshot
curl -X POST http://10.0.0.4:8428/snapshot/create

# List snapshots
curl -s http://10.0.0.4:8428/snapshot/list

VictoriaMetrics unlocks affordable multi-year metric retention without infrastructure bloat.

Deploy high-capacity VictoriaMetrics monitoring storage on Netbay Linux VPS in under 60 seconds with High-Speed SSD in Lucknow DC01 — netbayhosts.in.

Keep reading

Follow along on a real VPS

Deploy Linux in under 60 seconds

These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.

Deploy an instance