The only agent that thinks for itself

Autonomous Monitoring with self-learning AI built-in, operating independently across your entire stack.

Unlimited Metrics & Logs
Machine learning & MCP
5% CPU, 150MB RAM
3GB disk, >1 year retention
800+ integrations, zero config
Dashboards, alerts out of the box
> Discover Netdata Agents

Centralized metrics streaming and storage

Aggregate metrics from multiple agents into centralized Parent nodes for unified monitoring across your infrastructure.

Stream from unlimited agents
Long-term data retention
High availability clustering
Data replication & backup
Scalable architecture
Enterprise-grade security
> Learn about Parents

Fully managed cloud platform

Access your monitoring data from anywhere with our SaaS platform. No infrastructure to manage, automatic updates, and global availability.

Zero infrastructure management
99.9% uptime SLA
Global data centers
Automatic updates & patches
Enterprise SSO & RBAC
SOC2 & ISO certified
> Explore Netdata Cloud

Deploy Netdata Cloud in your infrastructure

Run the full Netdata Cloud platform on-premises for complete data sovereignty and compliance with your security policies.

Complete data sovereignty
Air-gapped deployment
Custom compliance controls
Private network integration
Dedicated support team
Kubernetes & Docker support
> Learn about Cloud On-Premises

Powerful, intuitive monitoring interface

Modern, responsive UI built for real-time troubleshooting with customizable dashboards and advanced visualization capabilities.

Real-time chart updates
Customizable dashboards
Dark & light themes
Advanced filtering & search
Responsive on all devices
Collaboration features
> Explore Netdata UI

Monitor on the go

Native iOS and Android apps bring full monitoring capabilities to your mobile device with real-time alerts and notifications.

iOS & Android apps
Push notifications
Touch-optimized interface
Offline data access
Biometric authentication
Widget support
> Download apps

The future of infrastructure observability

See our strategic direction across AI-native observability, full-stack signals, operational intelligence, and enterprise platform maturity.

AI-native observability
Full-stack signal coverage
Operational intelligence
Enterprise platform maturity
Agent releases every 6 weeks
Cloud continuous delivery
> Explore Product Roadmap

Best energy efficiency

True real-time per-second

100% automated zero config

Centralized observability

Multi-year retention

High availability built-in

Zero maintenance

Always up-to-date

Enterprise security

Complete data control

Air-gap ready

Compliance certified

Millisecond responsiveness

Infinite zoom & pan

Works on any device

Native performance

Instant alerts

Monitor anywhere

AI-native observability

Continuous delivery

Open source foundation

80% Faster Incident Resolution

AI-powered troubleshooting from detection, to root cause and blast radius identification, to reporting.

True Real-Time and Simple, even at Scale

Linearly and infinitely scalable full-stack observability, that can be deployed even mid-crisis.

90% Cost Reduction, Full Fidelity

Instead of centralizing the data, Netdata distributes the code, eliminating pipelines and complexity.

See and Map Your Entire Network

Live topology, flow analytics, and SNMP device and trap monitoring — unified with your full-stack observability.

Control Without Surrender

SOC 2 Type 2 certified with every metric kept on your infrastructure.

Integrations

800+ collectors and notification channels, auto-discovered and ready out of the box.

800+ data collectors
Auto-discovery & zero config
Cloud, infra, app protocols
Notifications out of the box
> Explore integrations
Real Results
46% Cost Reduction

Reduced monitoring costs by 46% while cutting staff overhead by 67%.

— Leonardo Antunez, Codyas

Zero Pipeline

No data shipping. No central storage costs. Query at the edge.

From Our Users
"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

No Query Language

Point-and-click troubleshooting. No PromQL, no LogQL, no learning curve.

Enterprise Ready
67% Less Staff, 46% Cost Cut

Enterprise efficiency without enterprise complexity—real ROI from day one.

— Leonardo Antunez, Codyas

SOC 2 Type 2 Certified

Zero data egress. Only metadata reaches the cloud. Your metrics stay on your infrastructure.

Full Coverage
800+ Collectors

Auto-discovered and configured. No manual setup required.

Any Notification Channel

Slack, PagerDuty, Teams, email, webhooks—all built-in.

Built for the People Who Get Paged

Because 3am alerts deserve instant answers, not hour-long hunts.

Every Industry Has Rules. We Master Them.

See how healthcare, finance, and government teams cut monitoring costs 90% while staying audit-ready.

Monitor Any Technology. Configure Nothing.

Install the agent. It already knows your stack.
From Our Users
"A Rare Unicorn"

Netdata gives more than you invest in it. A rare unicorn that obeys the Pareto rule.

— Eduard Porquet Mateu, TMB Barcelona

99% Downtime Reduction

Reduced website downtime by 99% and cloud bill by 30% using Netdata alerts.

— Falkland Islands Government

Real Savings
30% Cloud Cost Reduction

Optimized resource allocation based on Netdata alerts cut cloud spending by 30%.

— Falkland Islands Government

46% Cost Cut

Reduced monitoring staff by 67% while cutting operational costs by 46%.

— Codyas

Real Coverage
"Plugin for Everything"

Netdata has agent capacity or a plugin for everything, including Windows and Kubernetes.

— Eduard Porquet Mateu, TMB Barcelona

"Out-of-the-Box"

So many out-of-the-box features! I mostly don't have to develop anything.

— Simon Beginn, LANCOM Systems

Real Speed
Troubleshooting in 30 Seconds

From 2-3 minutes to 30 seconds—instant visibility into any node issue.

— Matthew Artist, Nodecraft

20% Downtime Reduction

20% less downtime and 40% budget optimization from out-of-the-box monitoring.

— Simon Beginn, LANCOM Systems

Pay per Node. Unlimited Everything Else.

One price per node. Unlimited metrics, logs, users, and retention. No per-GB surprises.

Free tier—forever
No metric limits or caps
Retention you control
Cancel anytime
> See pricing plans

What's Your Monitoring Really Costing You?

Most teams overpay by 40-60%. Let's find out why.

Expose hidden metric charges
Calculate tool consolidation
Customers report 30-67% savings
Results in under 60 seconds
> See what you're really paying

Your Infrastructure Is Unique. Let's Talk.

Because monitoring 10 nodes is different from monitoring 10,000.

On-prem & air-gapped deployment
Volume pricing & agreements
Architecture review for your scale
Compliance & security support
> Start a conversation

Monitoring That Sells Itself

Deploy in minutes. Impress clients in hours. Earn recurring revenue for years.

30-second live demos close deals
Zero config = zero support burden
Competitive margins & deal protection
Response in 48 hours
> Apply to partner

Per-Second Metrics at Homelab Prices

Same engine, same dashboards, same ML. Just priced for tinkerers.

Community: Free forever · 5 nodes · non-commercial
Homelab: $90/yr · unlimited nodes · fair usage
> Get the Homelab Plan

$1,000 Per Referral. Unlimited Referrals.

Your colleagues get 10% off. You get 10% commission. Everyone wins.

10% of subscriptions, up to $1,000 each
Track earnings inside Netdata Cloud
PayPal/Venmo payouts in 3-4 weeks
No caps, no complexity
> Get your referral link
Cost Proof
40% Budget Optimization

"Netdata's significant positive impact" — LANCOM Systems

Calculate Your Savings

Compare vs Datadog, Grafana, Dynatrace

Savings Proof
46% Cost Reduction

"Cut costs by 46%, staff by 67%" — Codyas

30% Cloud Bill Savings

"Reduced cloud bill by 30%" — Falkland Islands Gov

Enterprise Proof
"Better Than Combined Alternatives"

"Better observability with Netdata than combining other tools." — TMB Barcelona

Real Engineers, <24h Response

DPA, SLAs, on-prem, volume pricing

Why Partners Win
Demo Live Infrastructure

One command, 30 seconds, real data—no sandbox needed

Zero Tickets, High Margins

Auto-config + per-node pricing = predictable profit

Homelab Ready
Free Video Course

8-episode Netdata tutorial by LearnLinux.tv

76k+ GitHub Stars

3rd most starred monitoring project

Worth Recommending
Product That Delivers

Customers report 40-67% cost cuts, 99% downtime reduction

Zero Risk to Your Rep

Free tier lets them try before they buy

AI Support Assistant, Available 24/7

Nedi has access to all official documentation, source code, and resources. Ask any question about Netdata—responds in your language.

Deployment & configuration
Troubleshooting & sizing
Alerts & notifications
Evidence-based answers
> Ask Nedi now

Never Fight Fires Alone

Docs, community, and expert help—pick your path to resolution.

Learn.netdata.cloud docs
Discord, Forums, GitHub
Premium support available
> Get answers now

60 Seconds to First Dashboard

One command to install. Zero config. 850+ integrations documented.

Linux, Windows, K8s, Docker
Auto-discovers your stack
> Read our documentation

76,000+ Engineers Strong

615+ contributors. 1.5M daily downloads. One mission: simplify observability.

Per-Second. 90% Cheaper. Data Stays Home.

Side-by-side comparisons: costs, real-time granularity, and data sovereignty for every major tool.

See why teams switch from Datadog, Prometheus, Grafana, and more.

> Browse all comparisons
Edge-Native Observability, Born Open Source
Per-second visibility, ML on every metric, and data that never leaves your infrastructure.
Founded in 2016
615+ contributors worldwide
Remote-first, engineering-driven
Open source first
> Read our story
Promises We Publish—and Prove
12 principles backed by open code, independent validation, and measurable outcomes.
Open source, peer-reviewed
Zero config, instant value
Data sovereignty by design
Aligned pricing, no surprises
> See all 12 principles
Edge-Native, AI-Ready, 100% Open
76k+ stars. Full ML, AI, and automation—GPLv3+, not premium add-ons.
76,000+ GitHub stars
GPLv3+ licensed forever
ML on every metric, included
Zero vendor lock-in
> Explore our open source
Build Real-Time Observability for the World
Remote-first team shipping per-second monitoring with ML on every metric.
Remote-first, fully distributed
Open source (76k+ stars)
Challenging technical problems
Your code on millions of systems
> See open roles
Meet the Team Behind Netdata
Conferences, meetups, and tradeshows where you can see Netdata in action and talk to the engineers who build it.
Live demos and deep dives
Book 1-on-1 meetings
Talks and panel sessions
Event recaps and photos
> See all events
Talk to a Netdata Human in <24 Hours
Sales, partnerships, press, or professional services—real engineers, fast answers.
Discuss your observability needs
Pricing and volume discounts
Partnership opportunities
Media and press inquiries
> Book a conversation
Your Data. Your Rules.
On-prem data, cloud control plane, transparent terms.
Trust & Scale
76,000+ GitHub Stars

One of the most popular open-source monitoring projects

SOC 2 Type 2 Certified

Enterprise-grade security and compliance

Data Sovereignty

Your metrics stay on your infrastructure

Validated
University of Amsterdam

"Most energy-efficient monitoring solution" — ICSOC 2023, peer-reviewed

ADASTEC (Autonomous Driving)

"Doesn't miss alerts—mission-critical trust for safety software"

Community Stats
615+ Contributors

Global community improving monitoring for everyone

1.5M+ Downloads/Day

Trusted by teams worldwide

GPLv3+ Licensed

Free forever, fully open source agent

Why Join?
Remote-First

Work from anywhere, async-friendly culture

Impact at Scale

Your work helps millions of systems

$ guides / pgbouncer / pgbouncer-client-connection-leak ▌

Operations Guides

PgBouncer client connection leak: idle clients that never disconnect

used_clients keeps climbing. Traffic is flat, cl_waiting is zero, queries are fast, and yet the client count creeps toward max_client_conn day after day. When it gets there, PgBouncer starts rejecting new connections with no more connections allowed (max_client_conn), even though the database itself is completely healthy.

This is a client-side connection leak: application instances open connections to PgBouncer and never close them. PgBouncer is doing exactly what it is told to do, holding those sockets open. The pooler just makes the leak visible earlier and more painfully, because it has a hard front-door limit.

PgBouncer exposes enough state to find the leaking clients precisely, and recent versions (1.24+) give you tools to reap them without a restart. This guide covers detection, distinguishing a real leak from expected long-lived connections, and remediation.

What this means

Every client connected to PgBouncer consumes a file descriptor, a small amount of memory, and one slot out of max_client_conn. A client that connects and never disconnects holds all of that indefinitely, whether it ever sends a query or not.

The cost depends on what the leaked client is holding:

  • Idle client, no transaction open (cheap). In transaction pooling mode, an idle client holds no server connection. It costs an FD, some memory, and a client slot. Thousands of these slowly march you toward max_client_conn, but they do not starve the server pool.
  • Client that ran BEGIN and wandered off (expensive). In transaction mode, a client inside an open transaction holds a server connection in sv_active state for as long as the transaction stays open. Enough of these and the pool exhausts: cl_waiting grows, maxwait climbs, and you have the full pool exhaustion cascade on top of the leak. idle_transaction_timeout exists for exactly this case.

The failure ends in one of two places: the front door closes (used_clients hits max_client_conn and new connections are refused with no queuing and no warning), or the server pool starves (leaked in-transaction clients pin every server connection). This article is about the leak underneath both.

flowchart TD
  A[used_clients drifting up] --> B{SHOW CLIENTS: old connect_time, no recent request_time?}
  B -- no --> C[Not a leak: legitimate traffic or capacity issue]
  B -- yes --> D{Client holds a server link?}
  D -- yes --> E[Expensive: idle-in-transaction, pins sv_active]
  D -- no --> F[Cheap: idle client, holds FD + client slot only]
  E --> G[idle_transaction_timeout + app fix]
  F --> H[client_idle_timeout + app fix]

Common causes

CauseWhat it looks likeFirst thing to check
Application opens connections and never closes themused_clients grows monotonically, uncorrelated with query rate; many clients with very old connect_time and stale request_timeSHOW CLIENTS sorted by connect_time, grouped by source addr
Deployments roll without draining old instancesConnection count steps up at each deploy and never steps back down; connections from IPs of retired hosts or podsCompare addr values in SHOW CLIENTS against your current instance inventory
App-side pool with no max lifetime or idle timeoutA fixed cohort of very old connections per app instance, oldest matching instance start time; stable, not growingApp pool config (HikariCP maxLifetime, pgx, psycopg pool settings). This is expected behavior, not a leak, until instance count grows
Clients that BEGIN and never COMMITSubset of old clients linked to server connections; sv_active elevated with avg_xact_time >> avg_query_timeSHOW SERVERS for active connections with old request_time; PostgreSQL pg_stat_activity for idle in transaction
Load balancer or health checks holding connectionsSteady background count of connections from LB addressesSHOW CLIENTS filtered to LB source addresses
Retry loops during past incidents left orphansOne step-up in client count that never recovered after an earlier outageCorrelate the connect_time cluster with the earlier incident window

The hardest judgment call is the third row: application connection pools are supposed to hold long-lived connections. An old connect_time alone is not a leak. The leak signature is growth uncorrelated with traffic, plus connections whose request_time never advances, plus connections from instances that no longer exist.

Quick checks

All read-only, run against the admin console. Adjust host and port for your deployment.

# Client capacity: used vs free slots
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW LISTS;" | grep -E "used_clients|free_clients"

# The configured limit
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW CONFIG;" | grep max_client_conn

# Full client table for offline analysis (state, addr, database, user, connect_time, request_time, ...)
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW CLIENTS;" > /tmp/clients.txt

# Connections per source address: which host or subnet is hoarding
awk -F'|' '{print $4}' /tmp/clients.txt | sort | uniq -c | sort -rn | head -20

# Are any old clients holding server connections? (expensive leak)
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW SERVERS;" > /tmp/servers.txt

# Transaction hold time vs query time: a large gap means idle-in-transaction
psql -h 127.0.0.1 -p 6432 -U pgbouncer pgbouncer -Atc "SHOW STATS_AVERAGES;"

# FD pressure on the PgBouncer process
ls /proc/$(pgrep -f pgbouncer)/fd | wc -l
grep "Max open files" /proc/$(pgrep -f pgbouncer)/limits

Column positions in the -At output are version-dependent; the SHOW CLIENTS field order changed when columns were added in 1.23, so verify which field is addr on your version before trusting the awk position. Safer: run SHOW CLIENTS; once in aligned mode to see the header, then fix the field index.

How to diagnose it

  1. Confirm the growth pattern. Sample used_clients from SHOW LISTS a few times over an hour. A leak grows monotonically or in steps (at deploy time) and never comes down. Legitimate load tracks traffic and falls during quiet periods. Also check query_count in SHOW STATS_AVERAGES: flat or falling query rate with rising client count is the smoking gun.

  2. Identify the aged clients. From the captured SHOW CLIENTS output, find rows where connect_time is hours or days old and request_time is equally stale (no recent activity). On PgBouncer 1.25.0+, SHOW CLIENTS has an explicit idle state, which makes this trivial. On earlier versions there is no idle state; idle clients appear as active or used and you must infer idleness by comparing connect_time against request_time.

  3. Split cheap leaks from expensive leaks. For each suspect client, check the link column. A non-empty link means the client is paired with a server connection. Cross-reference SHOW SERVERS: an active server connection with an old request_time whose state in PostgreSQL’s pg_stat_activity is idle in transaction is the expensive variant. These clients are eating pool capacity right now, not just client slots.

  4. Attribute by source. Group the leaked connections by addr and by database/user. One source IP with thousands of connections points at a single misbehaving instance or a leaked pool in one service. Connections from IPs that no longer map to any live instance confirm orphaned connections from retired deployments.

  5. Rule out look-alikes. Check SHOW DATABASES for paused or disabled flags before treating anything as an incident. Confirm that the count is not simply (app pool size x instance count) doing exactly what the app was configured to do; if instances scale out and each holds 20 connections, used_clients climbs legitimately and the fix is capacity, not leak hunting.

  6. Quantify headroom. Compare used_clients against max_client_conn, and the process FD count against the ulimit. Above 80% of either, you are one deploy or one traffic spike away from refusals. Admin connections to the pgbouncer database are exempt from max_client_conn, so you will not lock yourself out of the console.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
used_clients / max_client_connThe front-door utilization; at 100% new connections are refused instantly>80% sustained, or steady upward trend uncorrelated with traffic
free_clientsPre-allocated client slots remaining; zero means refusals are happening nowBelow 10% of max_client_conn
Client connection age distribution (SHOW CLIENTS connect_time, request_time)Direct leak detection: old connect_time with stale request_timeGrowing cohort of connections older than the oldest running app instance
avg_xact_time vs avg_query_timeThe gap measures idle-in-transaction time, the expensive leakRatio consistently above ~10x
sv_active with old request_time (SHOW SERVERS)Finds leaked transactions pinning server connectionsActive server connections idle for minutes or hours
PgBouncer process FD count vs ulimitFD exhaustion can refuse connections before max_client_conn is reached>80% of Max open files
query_count trendBaseline to prove client growth is not traffic growthClient count up, query rate flat or down

Note the instrumentation gap: PgBouncer has no counter for refused connections. no more connections allowed appears only in the log. If you are not parsing the log, the first signal of a full front door is application-side errors.

Fixes

Reap idle clients: client_idle_timeout

PgBouncer 1.24.0 added client_idle_timeout: client connections idle longer than N seconds are closed. Default is 0 (disabled). This is the direct fix for the cheap leak variant. Two cautions:

  • The official docs flag this as a potentially dangerous timeout. Set it higher than the client-side pool’s own idle timeout and connection lifetime, otherwise PgBouncer will close connections the application still considers valid, and the app will see unexpected errors on its next query.
  • It does nothing for the expensive variant. A client inside an open transaction is not idle in this sense.

Kill specific leaked clients: KILL_CLIENT

Also added in 1.24.0, KILL_CLIENT terminates a single client connection from the admin console. This is the surgical option for a handful of obvious orphans (for example, connections from an instance that was decommissioned last week) without touching healthy traffic. Prefer it over KILL, which drops every connection for a database.

Reap idle transactions: idle_transaction_timeout

For the expensive variant, idle_transaction_timeout (default 0, disabled) closes clients that sit inside an open transaction without doing work. This frees the pinned server connection back to the pool. Same caution applies: applications with legitimately long interactive transactions will get disconnected.

Cap per-user and per-database client counts

1.24.0 added max_user_client_connections and max_db_client_connections. These contain the blast radius: one leaking service exhausts its own allowance instead of the global max_client_conn and taking the whole front door down. Sizing these requires knowing your per-service connection budgets; it is a capacity planning exercise, not just a leak fix. See PgBouncer capacity planning.

Fix the application (the actual root cause)

Every timeout above is a leash, not a cure. The durable fixes are in the application: ensure connections are returned or closed on every code path, configure the app pool’s maximum lifetime and idle timeout to be shorter than PgBouncer’s reaping timeouts, and make sure deployments drain or kill old instances cleanly. If the app pool deliberately holds long-lived connections, that is fine, but then max_client_conn must be sized for (pool size x instance count) with headroom, and tuned against real FD limits as covered in PgBouncer max_client_conn tuning.

Restart as last resort, with a version caveat

A restart clears everything, but it is the blunt option: it drops all healthy connections too and triggers a reconnection storm against PostgreSQL. If you do restart, note that since 1.23.0, SIGTERM performs a “super safe shutdown” that waits for all clients to disconnect. With leaked clients that will never disconnect voluntarily, a SIGTERM shutdown can hang indefinitely. SIGQUIT gives the old immediate-shutdown behavior. Plan for that before you are staring at a hung shutdown during an incident.

Prevention

  • Monitor the trend, not the threshold. Alert on used_clients / max_client_conn sustained above 80%, and separately on week-over-week growth of the ratio. Leaks are slow; a trend alert fires days before the wall.
  • Baseline client age. Periodically snapshot SHOW CLIENTS and track the age distribution. Alert when connections are older than the oldest live application instance, since nothing legitimate outlives its own process.
  • Set app-side lifetimes shorter than PgBouncer-side timeouts. The application should always recycle its own connections before the pooler kills them. That ordering keeps errors out of the app.
  • Contain with per-user or per-database caps so one leaking service cannot consume the global limit (1.24+).
  • Audit at deploy time. The step-up pattern (count rises at each deploy, never falls) means old instances are not draining. Fix graceful shutdown in the deploy pipeline.
  • Parse the log. no more connections allowed, client_idle_timeout events, and query_wait_timeout events exist only in the log. Refusals and reaping events are your confirmation that a leak reached production impact.

How Netdata helps

Netdata’s PgBouncer collector queries the admin console continuously, so the signals this guide uses are already time-series rather than manual snapshots:

  • Client slot utilization over time. used_clients and free_clients as a trend make the slow drift visible weeks before max_client_conn is hit, which is when a leak is still cheap to fix.
  • Wait time vs query time correlation. avg_wait_time against avg_query_time tells you whether latency comes from the pool or the database; avg_xact_time against avg_query_time exposes the idle-in-transaction variant of the leak.
  • Pool state correlation. If leaked transactions start pinning server connections, sv_active climbing toward pool_size alongside growing client counts shows the leak escalating from cheap to expensive.
  • Anomaly detection on client counts. A step-change in client connections with flat query throughput is exactly the pattern ML-based anomaly flags catch, without you hand-tuning a growth threshold.
  • Per-pool breakdown. Leaks are usually one service. Per-database and per-user views isolate the offender instead of averaging it away.