Files

5.5 KiB
Raw Permalink Blame History

weight, title, menu, tags, aliases
weight title menu tags aliases
22 Best practices
docs
identifier parent weight
vm-best-practices victoriametrics 22
metrics
guide
/BestPractices.html
/bestpractices/index.html
/bestpractices/

Install Recommendation

It is recommended to run the latest available release of VictoriaMetrics from this page, since it contains all the bugfixes and enhancements.

There is no need to tune VictoriaMetrics because it uses reasonable defaults for command-line flags. These flags are automatically adjusted for the available CPU and RAM resources. There is no need in Operating System tuning because VictoriaMetrics is optimized for default OS settings. The only option is to increase the limit on the number of open files in the OS, so VictoriaMetrics could accept more incoming connections and could keep open more data files.

Swap

For machines running vmstorage or Single-node VictoriaMetrics, it is recommended to disable swap. These components rely on available RAM for high performance operations. If swap is enabled, the operating system may move active data from fast RAM to the much slower disk as memory usage approaches system limits or configured thresholds. This leads to performance degradation and latency spikes. On systemd-based Linux distributions run:

sed -i '/\sswap\s/s/^/#/' /etc/fstab
systemctl mask swap.target

Reboot the host after applying the commands.

If you're unsure whether swap-related issues are occurring, check the Troubleshooting – Major page faults and Resource usage – Memory pressure panels in official Grafana dashboards.

Filesystem

The recommended filesystem for VictoriaMetrics is ext4. If you plan to store more than 1TB of data on ext4 partition, then the following options are recommended to pass to mkfs.ext4:

mkfs.ext4 ... -O 64bit,huge_file,extent -T huge

VictoriaMetrics should work OK with other filesystems too.

Operating System

VictoriaMetrics is production-ready for the following operating systems:

  • Linux (Alpine, Ubuntu, Debian, RedHat, etc.)
  • FreeBSD
  • OpenBSD
  • Solaris/SmartOS

There is an experimental support of VictoriaMetrics components for Windows.

VictoriaMetrics can also run on macOS for testing and development purposes.

Supported Architectures

  • Linux: i386, amd64, arm, arm64, ppc64le, s390x
  • FreeBSD: i386, amd64, arm
  • OpenBSD: i386, amd64, arm
  • Solaris/SmartOS: i386, amd64
  • macOS: amd64, arm64 (for testing and development purposes)
  • Windows: amd64

Kubernetes

VictoriaMetrics natively supports deployment in Kubernetes via helm charts and kubernetes operator. See how to start using k8s operator.

Common recommendations:

  1. Prefer setting requests equal to limits for stateful components like vmstorage to avoid unnecessary component restarts.

  2. Avoid using fractional CPU units when configuring resources for optimal performance. VictoriaMetrics is written in Go and its runtime requires specifying integer number of concurrently running threads. When fractional CPU unit is specified, VictoriaMetrics will automatically round it down.

Upgrade procedure

It is safe to upgrade VictoriaMetrics to new versions unless the release notes say otherwise. It is safe to skip multiple versions during the upgrade unless release notes say otherwise. It is recommended to perform regular upgrades to the latest version, since it may contain important bug fixes, performance optimizations or new features.

It is also safe to downgrade to the previous version unless release notes say otherwise.

The following steps must be performed during the upgrade / downgrade procedure:

  • Send SIGINT signal to VictoriaMetrics process to stop it gracefully.
  • Wait until the process stops. This can take a few seconds.
  • Start the upgraded VictoriaMetrics.

Backup Recommendations

VictoriaMetrics supports backups via vmbackup and vmrestore tools. There is also vmbackupmanager, which simplifies backup automation.

Technical Support and Services

Technical support for VictoriaMetrics is available using the following channels:

We also provide Enterprise support.