Configure environment variables for PMM Server (Virtual machines: AMI/OVF)¶
Set up environment variables in the systemd environment file to customize performance, storage, features, and other settings without modifying the container directly. Use these instructions if you have PMM Server running on:
- AWS AMI instances: EC2 instances deployed from AWS Marketplace
- Virtual appliances (OVF): Deployed on VirtualBox and some other virtualization platforms
Both deployment types use the same systemd user service that launches a Podman container, with environment variables configured through a dedicated environment file.
Configure environment variables¶
Your PMM Server runs as a systemd user service that launches a Podman container. You can customize its behavior by setting environment variables in the pmm-server.env file on your virtual machine.
To set environment variables for PMM Server on virtual machine deployments:
-
Connect to your PMM Server virtual machine via SSH using the
adminuser (see SSH configuration for authentication setup):ssh -i your-key admin@<pmm-server-ip> -
Open
/home/admin/.config/systemd/user/pmm-server.envand edit the environment variables file. This file is automatically loaded by thesystemdservice:nano ~/.config/systemd/user/pmm-server.env -
Add your desired environment variables in
KEY=VALUEformat:PMM_DEBUG=true PMM_ENABLE_ACCESS_CONTROL=true -
Restart the PMM Server service to apply the changes:
systemctl --user restart pmm-server -
Verify the service is running with the new configuration:
systemctl --user status pmm-server
Available variables¶
Unlike Docker deployments that use -e flags, virtual machines configure PMM Server using the systemd environment file instructions above. However, PMM uses the same list of environment variables across all deployment methods.
Common examples for virtual machines¶
These variables are particularly useful for both AWS AMI and virtual appliance deployments:
| Variable | Default | Description |
|---|---|---|
PMM_DATA_RETENTION |
30d |
Duration to retain metrics data |
PMM_ENABLE_UPDATES |
true |
Allow version checks and updates |
PMM_ENABLE_ACCESS_CONTROL |
true |
Enable label-based access control (LBAC) |
PMM_PUBLIC_ADDRESS |
Auto-detected | External DNS/IP for PMM Server |
PMM_DEBUG |
true |
Enable verbose logging |
PMM_METRICS_RESOLUTION |
1s |
Base metrics collection interval |
VictoriaMetrics performance tuning¶
PMM Server uses VictoriaMetrics as its metrics storage engine. For high-volume environments or extended retention periods, you may need to tune VictoriaMetrics settings to optimize performance and resource usage. To do this:
-
Add the following variables to your
pmm-server.envfile:# Configure disk space limit per client during network outages VMAGENT_remoteWrite_maxDiskUsagePerURL=52428800 # Configure temporary data storage path VMAGENT_remoteWrite_tmpDataPath=/tmp/custom-vmagent # Configure logging verbosity level VMAGENT_loggerLevel=DEBUG # Configure maximum scrape size per target VMAGENT_promscrape_maxScrapeSize=128MiB -
Restart the PMM Server service after changing environment variables for VictoriaMetrics and monitor disk space when extending retention periods.
When to configure these settings:
- Large deployments (>100 monitored nodes): increase query timeout and adjust memory limits
- Extended retention (>30 days): Set
VM_retentionPeriodindependently fromPMM_DATA_RETENTIONfor finer control - Memory-constrained environments: reduce
VM_memory.allowedPercentto prevent OOM issues - High write volume: add merge speed optimization for better ingestion performance