Sizing Prometheus disk and memory

Estimate Prometheus disk from ingestion rate and retention, understand what drives memory use, and decide when one server should be split. Scope and tuning are agreed before changes are made.

On this page

Sizing Prometheus disk and memory before the server runs out

Disk usage in Prometheus follows ingestion rate and retention, and memory follows active series, series churn, remote write queues and query load. If your Prometheus server is filling its disk, using more memory than expected, or about to be asked to scrape more targets, sizing work should come before the next change, not after the server runs out of room. The first step is to measure what you already ingest rather than guess from the number of hosts you run.

Local storage in Prometheus is a single-node time series database. The Prometheus storage documentation states that it is not clustered or replicated and should be managed like any other single-node database. That means one server holds the only copy of its data, and a full disk, an out-of-memory kill or a corrupted block affects every dashboard and alert that depends on it. Capacity decisions therefore carry real weight: you cannot add a node to absorb the load, so headroom has to be planned on the server you have, or the data has to move to a system designed to scale.

Schedule this work when a trend shows up, not when an alert fires. Typical triggers are disk use climbing faster than retention predicts, scrape durations or memory growing after a new exporter or service discovery rule goes live, a plan to onboard a new team or cluster, or a decision to add remote write or a second server. Ask your team to confirm current ingestion rate, active series count and retention settings in the prometheus.yml file and the command-line flags before the review, because those values determine every estimate that follows.

How to estimate Prometheus disk from ingestion and retention

This sequence turns measured ingestion from your own Prometheus server into a disk estimate for a chosen retention period, with headroom and a check against the storage docs. The output is a sizing figure you can defend in a capacity review.

  1. Confirm the current storage formula and sample size

    Before any arithmetic, open the Prometheus storage documentation and read the disk sizing formula and the bytes-per-sample figure it currently gives. The formula multiplies retention time by ingested samples per second and bytes per sample, and the docs present it as an approximation. Record the version of Prometheus you run, because the guidance can change between releases. The step is done when you have written down the formula, the sample size, and the version they apply to.

  2. Measure the current ingestion rate

    Query the server's own metrics for the rate of samples appended to the head block, using the prometheus_tsdb_head_samples_appended_total counter with the rate function over a window that covers normal load, such as a full business day. Run the query in the Prometheus expression browser or your Grafana instance that reads this server. Check the result against the scrape counts in your targets page so the numbers are consistent. The step is done when you have a samples-per-second figure with a stated time window and a note on any unusual load during that window.

  3. Measure the current disk footprint per sample

    Check the bytes actually stored per sample on your server rather than relying only on the documented figure. Read the TSDB size from the storage metrics or the data directory size, and divide it by the number of samples retained over the same period, using the head and block metrics to confirm the sample count. Compare this with the bytes-per-sample value in the storage docs. A large gap usually points to high series churn or many label values, so note both. The step is done when you have a measured bytes-per-sample value with the method and period recorded.

  4. Set the retention target

    Decide how long the server must keep data, and decide whether the limit is set by time or by size. The default retention is 15 days, which you can change in the server's configuration, and you can also cap the storage by size. Write both limits if you intend to use them together, since the first limit reached applies. Confirm with the team that owns incident review and capacity planning how far back queries must reach. The step is done when you have a written retention period and a size cap, or an explicit statement that only time-based retention applies.

  5. Calculate the raw disk requirement

    Multiply the retention period in seconds by the measured samples per second and by the measured bytes per sample. Use the documented formula as a cross-check, and explain any difference between the two results in your notes. Keep units consistent, converting days to seconds and bytes to gigabytes at the end. For illustration only, a server ingesting a steady stream of samples over several days will need disk in proportion to those three inputs, so a doubling of any one doubles the result. The step is done when you have a raw gigabyte figure with each input shown beside it.

  6. Add headroom and check the result against disk limits

    Add a margin for ingestion growth, compaction activity, and the write-ahead log, then compare the total with the disk you can provision. The storage guidance advises against letting the disk fill, so size the volume so the retention limit is reached well before the disk is full. Ask your storage or platform team for the actual free-space alerting threshold they use. The step is done when you have a provisioned size, a stated margin, and an alert on disk usage that fires before the retention limit can be reached.

  7. Re-measure after a change in load

    Repeat the ingestion and bytes-per-sample measurements after any significant change, such as a new exporter, a new Kubernetes namespace, or a change to label sets. Compare the new figures with the original estimate and record the difference. Schedule the re-measurement as part of your normal review, and treat any growth beyond the margin as a trigger to revisit retention or the server design. The step is done when the new results are written next to the original estimate and the sizing decision is confirmed or updated.

What drives Prometheus memory use

Memory use in Prometheus follows the active series held in the head block, the in-memory part of the time series database that receives every new sample before it is compacted into a two-hour block. Each active series carries its label set and recent samples in RAM, so the number of distinct series a server ingests is the first figure to measure. Check the active series count on the server's own status endpoints and in the prometheus_tsdb_head_series metric, then compare it against the count you assumed during planning. A flat series count does not mean a flat memory profile, because the cost depends on how long those series stay alive.

Series churn is the second driver. When label sets appear and disappear, for example from short-lived pods, batch jobs or deployments that change a version label, Prometheus creates new head series and retires old ones. The total count can stay steady while the head block keeps allocating and releasing memory and the write-ahead log grows with every new series it records. Watch the rate of series creation and removal over time, and treat unbounded labels such as request IDs or unique hostnames as a design defect to fix before adding capacity. Remote write queues, query load and rule evaluation then add memory on top of the head block: each remote write shard holds samples in buffers, expensive PromQL queries materialize large intermediate results, and recording rules over many series create their own working sets. Measure each of these under real load, because their share varies by environment.

The two-hour blocks and the write-ahead log are part of the storage design, and their sizes on your server determine how much data sits in memory and on the replay path after a restart. Do not assume figures for either. Measure the head block's time span, the WAL size and restart replay time on a running server during a normal day and during a peak, then use those measurements in your memory plan. The Prometheus storage documentation describes how these components fit together, and your own readings should confirm how they behave in your estate.

Options for lowering ingestion and splitting load

This table compares six levers for reducing disk, memory and query load on a Prometheus server, with the resolution or history each one gives up. Use it to pick the change that fixes your bottleneck before you add hardware or split the server.

LeverWhat it reducesTrade-offWhen it fits
Drop or relabel unneeded seriesActive series, so memory, head block size and disk per sampleMetrics you drop cannot be queried or alerted on later, and relabel rules add config to maintainSeries nobody graphs or alerts on, often high-cardinality labels added by instrumentation
Increase scrape interval for low-change targetsSamples written per second, so disk growth and ingestion workCoarser resolution, so short spikes may disappear and rate windows need to be longerSlow-moving infrastructure metrics such as capacity or inventory, where minute-level detail adds little
Reduce target count per serverScrape load, active series and memory on that serverMore servers to run, back up and patch, and queries must span themA single server is consistently near its memory or ingestion limits after series cleanup
Shorten local retentionDisk used by stored blocksLess history is available for incident review and trend analysis on that serverDisk is the constraint and a longer history is already held in external storage
Move long-term data to remote storageLocal disk footprint, since blocks are sent elsewhereRemote write adds network traffic, a second system to operate, and a risk of falling behind if the queue is undersizedHistory must outlast local retention and you need a global query view
Shard targets across serversMemory and ingestion per server, spread across several instancesQueries and alerts need a way to see all shards, and each shard still needs its own disk and backupsOne server cannot keep up after cleanup and you can accept per-shard operations

When to split a Prometheus server

A single Prometheus server is simple to operate until one of a few resource limits starts to bind. The cards below name the signals that show a server has outgrown one host, the usual response to each, and the sibling topics that cover the work in detail.

Memory grows faster than targets

Memory in Prometheus tracks the number of active series in the head block, not the number of targets alone. If memory climbs while the target count stays flat, look at label churn, such as pod names or request IDs embedded in labels, and at new high-cardinality metrics. Trimming labels is the first fix. If the series count is legitimately large, plan to shard scrape targets across several servers, using the sharding topic as the next read.

Ingestion near host capacity

Check the ingestion rate and CPU usage of the server against the host it runs on, and track how close each scrape cycle comes to its interval. When one host cannot keep up with scraping and rule evaluation, split the targets across several Prometheus servers with sharding. The sharding topic covers hashmod relabeling and how alerts and queries work across shards.

Query latency under load

Slow dashboards and rule evaluations that miss their intervals often point to queries that scan too many series over long ranges, not to a lack of disk. Measure query duration during the busiest dashboards and recording rule runs. If latency grows with the number of users rather than the data, add a query layer such as Thanos Querier or Grafana Mimir, or move long-range dashboards to recording rules. The Thanos and Mimir topics explain each option.

Retention beyond local disk

Local storage is a single-node database with no replication, and default retention is 15 days. If audit or capacity reviews need months or years of history, the server cannot hold it on local disk at a sensible cost. Send samples to a long-term store with remote write, so the server keeps scraping and alerting while the store holds history. The Thanos, Mimir and VictoriaMetrics topics compare the options.

Remote write falling behind

If the remote write queue keeps growing, samples wait in the write-ahead log and memory rises with them. Watch the metrics that show pending samples and the write delay. When the receiver cannot keep up, tune the queue settings or add receiver capacity before splitting the server. The remote write tuning topic covers queue capacity, shards and the two-hour WAL limit.

Edge sites with weak links

Sites with limited bandwidth or unreliable links often do not need a full server each. Run Prometheus in agent mode to scrape locally and forward samples to a central server, which keeps local collection running during outages. Confirm the link capacity and the central server's ability to accept writes before choosing this design. The remote write receiver topic covers the central endpoint.

How ingestion, memory and disk relate

The diagram starts with scrape targets that Prometheus pulls from, passes samples through scrape and relabeling, and places them in the head block in memory with a write-ahead log on disk. Every two hours the head is compacted into an immutable block on local disk, which is where retention applies. Remote write and query paths branch off the head and blocks, so memory pressure comes from active series, churn and queues, while disk pressure comes from retained blocks and the WAL. Check each lever against the stage it acts on.

Memory-bound stages and disk-bound stages in the Prometheus ingestion path.

Sizing differences for single servers, HA pairs and remote storage

A single Prometheus server is the simplest case for sizing because it holds the only copy of its data. Its local time series database keeps data in two-hour blocks with a write-ahead log, and the default retention is 15 days, configurable by time or size. Local storage is not clustered or replicated, so the disk must hold the full retention window for every series the server ingests, and memory must hold the active series in the head block. Sizing starts from the ingestion rate and retention, then adds headroom for compaction and for the disk to stay below the level where Prometheus could run out of space.

  • Disk is the full retention window: every retained sample sits on this one disk, so retention and ingestion rate set the requirement directly.
  • Memory tracks active series: the head block holds recent series in memory, so churn and label cardinality drive RAM use.
  • No second copy exists: a failed disk or server means a gap in history unless backups are in place.
  • Scraping and querying share one process: heavy queries add memory pressure on the same host that scrapes targets.
  • Retention changes need a restart or reload: plan the size limit before the disk fills.

Before you commit to a size, confirm the active series count and the sample ingestion rate from your own server's metrics, then size the disk against your retention target.

Security and operational considerations for capacity changes

Capacity work often means editing retention, relabeling and remote write settings on a live server. The cards below cover the controls that keep those changes from opening new attack paths, filling the disk or losing history.

Keep admin and lifecycle endpoints off

Tuning sessions tempt teams to switch on the admin API or lifecycle endpoints to reload or delete series quickly. The --web.enable-admin-api flag enables destructive operations and --web.enable-lifecycle enables reload and shutdown, and both are disabled by default. Leave them disabled and make changes through the configuration file and a restart or reload from your deployment tooling, then confirm the flags are absent from the running process arguments.

Security model

Require TLS before basic authentication

If you add HTTP basic authentication to the web UI or API while sizing the server, the credentials travel in cleartext unless TLS is enabled. Prometheus supports TLS and client certificates with TLS 1.2 as the minimum, and stores basic auth passwords as bcrypt hashes. Enable TLS first, then add the basic auth block, and test from outside the network that plain HTTP connections are refused.

Security model

Alert before the disk fills

Retention is sized against disk, so a surge in series or a larger scrape interval can push the data directory toward full. A full disk stops new samples from being written and can corrupt recent blocks. Add an alert on free disk space for the Prometheus volume and check it against the retention settings you chose, so the warning fires well before the limit is reached.

Default retention
15 days

Back up the data directory safely

The storage docs say local storage is not clustered or replicated and should be managed like any other single-node database. Copying the data directory while Prometheus writes can produce inconsistent blocks, so use a filesystem snapshot or the snapshot API and keep a copy outside the server. Confirm that a restore works on a test host before you rely on it during a capacity change.

Storage docs

Review relabeling changes before rollout

Relabeling rules decide which series are kept, dropped or renamed, so a small edit can add millions of series or silently drop the ones your alerts depend on. Store the metric_relabel_configs and write_relabel_configs changes in version control, require a peer review, and compare the active series count and the affected alert queries before and after the change.

Restrict who can reach exporters

Exporters such as SNMP and Blackbox take targets from URL parameters, so anyone who can reach them over HTTP can make them send requests to arbitrary endpoints. When you raise scrape volume or add exporters to relieve memory pressure, place exporters on a management network, limit which hosts can scrape them, and confirm that no target list can be set from an untrusted client.

Security model

Questions teams ask before sizing Prometheus

How much does a Prometheus sizing exercise cost?

A sizing exercise costs the time of the people doing the measurement, analysis and write-up, plus any load testing you run. Cost moves with the number of Prometheus servers in scope, how many targets and series they hold, whether you already have dashboards that show ingestion rate and memory, and how many workloads need separate sizing. Prometheus itself is licensed under Apache-2.0 with no paid edition, so the money goes to infrastructure, storage, implementation and the people who run it. When you request a quote, ask for the written scope, the metrics the work will read, the test environment and the deliverables, including the sizing model and a retest plan after changes.

How long does sizing Prometheus take, and what does it need from my team?

Duration depends on how much data is already available. A team with existing Prometheus self-metrics dashboards can gather ingestion rate, active series and memory history quickly, while a team with no history needs time for the server to collect a representative window first. Your team needs to provide access to the Prometheus servers, a view of the target inventory, the retention you want, the expected growth in services and any remote write or query workloads. Confirm the timeline in the written scope, because the window of observation sets the lower bound on how long the work takes.

Can my team size Prometheus without outside help?

Yes, many teams can. The storage documentation gives a formula for disk: retention time multiplied by ingestion rate multiplied by bytes per sample, with a margin on top. You need reliable figures for ingested samples per second and for the retention you want, both of which Prometheus exposes through its own metrics. Memory is harder to estimate from a formula because it depends on active series, churn, remote write queues and query load, so teams usually measure it under real load. Get outside help when the estate is large, when several servers share load, or when you need evidence for an audit.

What data should we provide before a sizing review?

Provide the Prometheus configuration files, the scrape job list with target counts, and read access to the self-monitoring metrics for each server. Useful inputs include ingestion rate over time, number of head series, memory use, WAL size, disk capacity and used space, rule evaluation and query durations. Also share your target retention, your remote write destinations, the number of Alertmanager instances, and any planned growth such as new clusters or exporters. Missing history makes the estimate less reliable, so list any periods with unusual traffic, such as incidents or batch jobs.

How often should we revisit Prometheus sizing?

Revisit sizing whenever something changes the inputs: new services or exporters, a rise in label values that increases series count, a change in scrape interval, a new retention target, or a new remote write or query consumer. Many teams also review it on a regular schedule, tied to capacity planning or to Prometheus release upgrades. Prometheus minor releases follow a six-week cycle, and only long-term support lines get bug fixes for a year, so plan a recheck after each upgrade. Track head series and ingestion rate on a dashboard so the trend tells you when a review is due.

What changes when we add long-term storage to Prometheus?

Adding long-term storage changes what the local server must hold. Prometheus local storage is a single-node database that is not clustered or replicated, and its default retention is 15 days. When you send samples to Thanos, Grafana Mimir or VictoriaMetrics, the local retention can often stay short because the external store keeps the history, but the Prometheus server still needs disk and memory for its head block, WAL and remote write queues. The external system adds its own storage, compute and operating effort, so ask for separate sizing of that tier and confirm how query load is split between the two.

Does sizing Prometheus cover security and compliance evidence?

Sizing is about capacity, but a sizing record also supports operational evidence. Capacity records, retention settings and alert rules that watch disk and memory help show that monitoring stays available. Sizing does not make Prometheus compliant, and it does not replace the controls for access, TLS and admin APIs. The Prometheus security model notes that admin HTTP APIs are disabled by default and that basic authentication without TLS exposes credentials, so confirm those settings separately. DeployOpen prepares systems and evidence for compliance assessments, but independent auditors issue any audit report.

Sizing steps and checks on a running server

This sequence turns an estimate into a measured sizing decision on a live server. Each step produces a number that you check against the step before, so disk, memory and retention settings rest on observed behavior.

  1. Measure current series, ingestion and disk

    A platform or monitoring engineer queries the running server. Read prometheus_tsdb_head_series for the active series count, take a rate of prometheus_tsdb_head_samples_appended_total over a window for samples per second, and record the disk used by the data directory. Record all three with timestamps across a normal working day, not a single moment. Done when the series count and ingestion rate show a stable pattern, and you can explain any spikes by a known deployment or event.

  2. Apply the storage formula to measurements

    Multiply the retention period in seconds by the samples ingested per second and by the bytes per sample. Confirm the bytes-per-sample figure in the Prometheus storage documentation, then compare it with your own result: divide the measured disk use by the samples actually stored. Check that the estimate and the measured disk use are close enough that you can explain any gap, such as compaction overhead or the write-ahead log. If they diverge widely, the ingestion rate or retention you used is probably wrong, so repeat step one before continuing.

  3. Set retention and size limits

    Set the time retention and the size limit in the Prometheus configuration file, leaving headroom on the disk for compaction, the write-ahead log and any other files on the volume. Agree the headroom with your operations team and record it in the runbook. Restart or reload the server using your normal change process. Check the effective values on the runtime status page of the web UI, and confirm that the oldest block in the data directory matches the time limit you set once the server has run for long enough to reach it.

  4. Load-test queries and remote write

    Replay representative dashboard and alert queries against a staging copy of the server with a comparable series count. Record query duration and memory during the run, and include the slowest queries your teams actually use. If remote write is configured, run it under the same load and watch pending samples and shard counts. Check that memory stays under the ceiling you planned at peak query load, and that the remote write queue does not keep growing across a sustained run. Tuning the queues is covered in a separate topic.

  5. Check memory against active series

    Compare the process memory, read from process_resident_memory_bytes, with the active series count from step one. Memory also reflects churn, the rate at which series appear and disappear, and query load, so note the values during the load test as well as during normal operation. Divide memory by active series to get a working ratio for your environment. Done when the ratio stays consistent across the measurements, which lets you project memory for a future series increase instead of guessing at it.

  6. Alert on disk and memory growth

    Write alerting rules for free disk space, memory use and series growth, using node_filesystem_avail_bytes if node_exporter runs on the host and process_resident_memory_bytes for the server process. Route the alerts through Alertmanager to a receiver your on-call team watches. Check the rules in staging by lowering a threshold temporarily to force a firing alert, then confirm the notification arrives and the alert clears when the condition ends. Confirm the thresholds leave enough time for someone to act before the disk fills or memory runs out.

  7. Decide when to split the server

    Repeat the measurements on a schedule and compare the trend with the capacity you planned in the earlier steps. Split the workload when the measured series count, ingestion rate or memory approaches the limit you set, using sharding, federation or external long-term storage depending on the problem. Write the threshold into the runbook with the owner who reviews it. Done when the threshold, the owner and the next review date are recorded, so the decision to split is made from the trend and not from a failed server.

How DeployOpen scopes Prometheus sizing work

DeployOpen scopes sizing work as a fixed-scope engagement, so the written scope comes before any measurement or change. The scope names the Prometheus servers in question, the questions to answer (disk for a given retention, memory headroom, whether to lower ingestion or split a server), the systems that read from or write to each server such as remote write receivers, Grafana and rule evaluation, and the deliverables. Most of the time spent on scoping goes into agreeing which inputs the client can provide, because the estimate depends on them: the ingestion rate, the number of active series, the retention period the business needs, and the disk and memory the servers run on today.

Measurement comes next, and it happens in the client's own environment. DeployOpen works from the server's own metrics, such as the ingested sample rate, the head series count, query load and remote write backlog, together with the storage and memory figures from the operating system and the container platform. The findings are written up with the inputs used, so the client's platform or capacity team can repeat the calculation. Recommendations cover the disk formula result, the memory headroom, changes to scrape intervals or label sets, and any point where a split or a move to remote storage is justified. Any configuration change, such as a new --storage.tsdb.retention.time value or a changed scrape job, is agreed in writing before it is made, and the client's team keeps the change record.

Sizing is not a one-time exercise, because series counts grow as teams add services and labels. Ongoing review of growth, retention and capacity is available as a retainer, and it can be scoped to the same servers. DeployOpen does not publish a price list. A quote follows from the written scope, so the client should ask for the scope, the assumed inputs, the deliverables and whether any follow-up review is included before comparing offers with an internal estimate.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.