---
title: "Autoscaling Lakebase Postgres"
description: "Neon's Lakebase Postgres resizes compute in place about once every 81 seconds by taking the maximum of three target sizes: CPU load (one-minute average kept under 90%), memory (polled every 100 ms by an in-VM monitor and kept under 75%), and the working set of the compute cache."
url: "https://swe.quest/articles/autoscaling-lakebase-postgres-63257ef0753db067"
canonical: "https://neon.com/blog/autoscaling-lakebase-postgres"
source: "Neon"
published: "2026-08-31"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 12
tags: ["postgres","capacity-planning","virtualization","algorithms","kubernetes"]
---

# Autoscaling Lakebase Postgres

A post on [Neon](https://swe.quest/sources/neon.md), published 2026-08-31, 12 min read, Deep dive. Original: [https://neon.com/blog/autoscaling-lakebase-postgres](https://neon.com/blog/autoscaling-lakebase-postgres)

## Summary

Neon's Lakebase Postgres resizes compute in place about once every 81 seconds by taking the maximum of three target sizes: CPU load (one-minute average kept under 90%), memory (polled every 100 ms by an in-VM monitor and kept under 75%), and the working set of the compute cache. The working set comes from a modified HyperLogLog that stores timestamps instead of bits, so it can estimate distinct pages for any window from 1 to 60 minutes. The algorithm then looks for a jump in that curve to find where the current workload ends, and projects growth forward to the next 20-second interval. Resizes are applied to running QEMU/KVM VMs via NeonVM, with a modified Kubernetes scheduler approving upscales, live migration when a node is full, and in-VM checks before any downscale.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Capacity planning](https://swe.quest/tags/capacity-planning.md) (Reliability & operations)
- [Virtualization](https://swe.quest/tags/virtualization.md) (Infrastructure)
- [Algorithms](https://swe.quest/tags/algorithms.md) (Architecture & design)
- [Kubernetes](https://swe.quest/tags/kubernetes.md) (Infrastructure)

## Prerequisites

- Postgres shared buffers ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- Kubernetes scheduling ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- HyperLogLog basics
- separation of storage and compute

## Keywords

Lakebase Postgres, Neon, HyperLogLog, NeonVM, Local File Cache, QEMU, KVM, autoscaler-agent

## Related posts

- [Dynamically estimating and scaling Postgres’ working set size](https://swe.quest/articles/dynamically-estimating-and-scaling-postgres-working-set-size-9625ea29ef0bf2ef.md): Neon · 2024-09-05 · Medium · 12 min read · PostgreSQL, Algorithms, Capacity planning, Caching, Serverless
  Neon autoscales Postgres compute to keep the workload's working set in memory, using a modified HyperLogLog whose register bits are replaced with timestamps so the number of distinct pages accessed can be estimated for any lookback window.
- [1 Year of Autoscaling Postgres: How it’s going, and what’s next](https://swe.quest/articles/1-year-of-autoscaling-postgres-how-it-s-going-and-what-s-next-a75ce75d92118903.md): Neon · 2024-04-15 · Hard · 8 min read · PostgreSQL, Virtualization, Capacity planning, Memory management, Kubernetes
  Neon autoscales Postgres by running each instance as a VM in Kubernetes (NeonVM), with a per-node autoscaler-agent, a modified scheduler, and an in-VM vm-monitor that resizes the Local File Cache.
- [Scaling serverless Postgres: How we implement autoscaling](https://swe.quest/articles/scaling-serverless-postgres-how-we-implement-autoscaling-6cecd10b4a114371.md): Neon · 2023-03-29 · Medium · 9 min read · PostgreSQL, Serverless, Kubernetes, Virtualization, Capacity planning
  Neon autoscales serverless Postgres by running each compute endpoint in a QEMU/KVM VM on Kubernetes (via its NeonVM controller) and hot-adding or removing CPU and memory based on load average.
- [Neon Autoscaling is Generally Available](https://swe.quest/articles/neon-autoscaling-is-generally-available-f402e1eef903aa23.md): Neon · 2024-08-26 · Easy · 6 min read · PostgreSQL, Serverless, Capacity planning, Kubernetes, Virtualization
  Neon's Postgres autoscaling is now generally available on all plans, including Free (up to 2 CPU, 8 GB RAM), adjusting CPU and memory to load between user-set minimum and maximum limits, with scale-to-zero.
- [How to reduce Postgres compute costs as you scale](https://swe.quest/articles/how-to-reduce-postgres-compute-costs-as-you-scale-00db750fe1e313ab.md): Neon · 2024-04-29 · Medium · 12 min read · PostgreSQL, Cost optimization, Capacity planning, Cloud platforms, Serverless
  Compute, not storage, usually dominates managed Postgres bills, and allocation-based services like Amazon RDS leave most provisioned capacity idle.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
