Tuning Metabase connection pools and Jetty threads

Metabase slows or hangs when its application database pool or web threads run out, and the logs show this as pool usage such as 12/15. This page explains how to read that signal, which settings to change, and what each change costs in database load and memory.

On this page

Tuning Metabase connection pools and Jetty threads: when a busy instance needs it

The first question for a team whose Metabase feels slow or unresponsive at peak times is whether the bottleneck sits in the application pool or in the threads that serve requests. Those two limits fail in different ways, and tuning the wrong one wastes effort. Metabase keeps a pool of connections to its App DB, the application database that stores questions, dashboards, users and settings. Each request that reads or writes that metadata borrows a connection from the pool. When the pool is full, requests wait, and the instance feels stuck even when the warehouse is idle.

Jetty is the web server embedded in Metabase, and its threads handle incoming HTTP requests. Raising thread count lets more requests be accepted and processed at once, but each extra thread that needs the App DB still competes for the same pool. For that reason, more threads with a small pool often just move the queue. Metabase logs report App DB connection usage as a ratio such as 12/15, and the environment variables documentation explains that a full pool makes Metabase slow or unresponsive. Check that ratio during a slow period before changing any setting, and confirm the exact variable names and defaults for your version in the Metabase environment variables documentation.

Tune these limits only after you rule out the usual causes. If the logs show the pool is rarely full, the slowness probably comes from slow queries, too many cards on one dashboard or warehouse contention, so caching and query fixes come first. If the pool stays at its ceiling while the database host has headroom, raising pool and thread limits is a reasonable next step, but only in small increments with the App DB host's capacity checked. Every extra connection also consumes memory and database resources on that host, so a larger pool is not free. Record the baseline, change one value, and compare pool usage and response times under the same load.

Which setting to change for which symptom

When Metabase logs show App DB connection usage at or near its ceiling, the application database pool is the first suspect. Metabase stores questions, dashboards, users and settings in the application database, so requests that need metadata wait for a free connection when the pool is full. Raising the App DB pool size can clear the queue, but it also means more open connections on the database server, which the database must be sized to carry.

  • Read the log line: Look for usage figures such as 12/15, which show connections in use against the configured maximum.
  • Check the database side: Confirm the application database server allows the connection count you plan to set and has memory for it.
  • Review slow queries first: Long-running queries hold connections, so a full pool can be a symptom of slow metadata or query work rather than too few connections.
  • Raise one step at a time: Increase the App DB pool in small increments and watch whether the queue clears.
  • Confirm the exact variable names and defaults for your version on the Metabase environment variables page.

The check that confirms the choice is whether usage in the logs stops reaching the maximum during peak use, with no new errors on the database server.

Pool and thread settings and when each fits

This table compares Jetty threads, the application database pool and warehouse connection pools by what each one limits, the symptom that points to it, the risk of raising it, and what to confirm in the environment variables docs. Read it before changing anything, because a slow dashboard can come from any of the three and raising the wrong one adds load without adding capacity.

SettingWhat it limitsSymptom that points to itRisk of raising itWhat to confirm
Jetty threadsConcurrent HTTP requests Metabase accepts and handles at oncePages and API calls queue under many simultaneous viewers, while the database and warehouse look idleMore requests run at once, so memory use and load on the App DB and warehouse can rise togetherThe thread setting name and accepted range in the environment variables docs for your release
Application database poolConcurrent connections Metabase opens to its own App DB (PostgreSQL, MySQL or H2)Logs show App DB connection usage at or near its maximum, such as 12/15, and the UI becomes slow or unresponsiveEach extra connection holds resources on the App DB server, which can slow the App DB itself if it is already constrainedThe pool size variable, its default, and the App DB server's own connection limit
Warehouse connection poolConcurrent queries Metabase runs against one data sourceQueries wait for a connection while the warehouse has spare capacity and the App DB is healthyMore simultaneous queries increase warehouse load and can start contention or queueing inside the warehouseWhether the pool setting is configurable per database in your version, and the warehouse's concurrency limits
Pool usage in logsShows how many App DB connections are in use at a momentRepeated high readings during peaks point to pool size; flat low readings rule it outReading logs at a single moment misleads, so sample across several peak periodsThe log format and level in your deployment, and where logs are collected
Order of changeOne setting at a time, starting with the layer that shows the symptomChanging threads and pools together makes it unclear which one helpedMultiple changes hide the true bottleneck and make rollback harderA test window and a written record of the value before and after each change

How to raise pools and threads without overloading the database

This sequence moves from a measured baseline to a tested, monitored change, so you raise Jetty threads or connection pools only when the logs show a pool is the bottleneck and the database has headroom for more connections.

  1. Capture a baseline of pool usage

    Before changing anything, collect Metabase logs from a period when users report slowness, and record the App DB connection usage lines, which appear in the form of a count such as 12/15. Note the time of day, the number of concurrent viewers, and which dashboards or questions were running. Ask the platform owner to confirm the log level and retention on your instance so the evidence covers the slow period. The step is done when you have a written record of peak usage and the times it occurred.

  2. Identify whether the App DB or warehouse is the constraint

    Compare the App DB pool usage against the slow periods. If the application database pool sits at its maximum while queries wait, the pool is a candidate constraint. If the pool has spare capacity but dashboards still take long, check the warehouse side: query run times, the number of queued queries, and whether the database itself reports high connection or CPU use. Ask your database team to confirm what they see on their side during the same window. Continue only if the evidence points to the Metabase pool or thread limit, not to slow warehouse queries.

  3. Confirm the database can accept more connections

    Before raising any limit, check the maximum connections the App DB (PostgreSQL or MySQL) and the source warehouse allow, and how many connections other applications already hold. Add up the pool maximums for every Metabase node plus other clients to confirm the total stays within the database limit with room for administrators. Ask your DBA to confirm the connection budget in writing. Continue only when the arithmetic leaves headroom; if it does not, the fix is usually fewer parallel queries or a larger database, not a bigger pool.

  4. Change one setting in a test environment

    Copy the production configuration into a test environment that uses the same Metabase version and a representative copy of the application database. Change one value only, such as the Jetty thread count or one pool maximum, and record the old and new values with the reason for the change. Check the environment variable names and their defaults in Metabase's environment variables documentation before editing the deployment. The step is done when the test instance starts cleanly and the change is recorded in your change log.

  5. Retest under representative load

    Replay a load that resembles your busiest period, using realistic concurrency, the dashboards people actually open, and the same warehouse. Watch App DB pool usage, query latency, error rates and warehouse connection counts during the run. Compare results with the baseline from the first step. Continue only if pool waits fall, latency improves, and the database stays within its connection and CPU budget. If the warehouse becomes the bottleneck instead, stop and return to the second step.

  6. Roll out the change with a rollback plan

    Apply the tested setting to production during a window your team agrees in advance, with the previous configuration ready to restore. Restart Metabase according to your deployment method and confirm that the new value is active in the logs or the admin diagnostics. Make sure someone can revert the change quickly if users report errors. The step is done when the production instance serves normal traffic on the new setting and the rollback steps have been written down.

  7. Keep monitoring pool usage after rollout

    Continue to review App DB pool usage, slow dashboard reports and warehouse connection counts for a period your team defines, comparing them with the baseline. Set an alert or a recurring log review so saturation returns to someone's attention rather than to user complaints. Record the final values and the decision in your operations runbook. The sequence is complete when pool usage, latency and database load stay within the limits you agreed, and when any further tuning is tracked as a new change.

How a Metabase request uses threads and pooled connections

A request starts in the user's browser, passes through the reverse proxy, and is handled by a Jetty thread in Metabase. For dashboard metadata, the thread borrows a connection from the application database pool. For a question, it borrows a connection from the warehouse pool and waits for the query to return. Metabase logs report App DB connection usage such as 12/15, and a full pool makes Metabase slow or unresponsive, so check that log line first when requests queue.

Requests pass through Jetty threads and borrow connections from two pools, and pool usage appears in the logs.

Operational risks of larger pools

Raising Jetty threads and pool sizes removes one bottleneck and moves pressure somewhere else. The cards below cover the places that pressure lands: the application database, the warehouse, memory, upgrades, access paths and the monitoring you rely on to notice problems.

More connections load the application database

Every App DB connection in the pool is a session that PostgreSQL or MySQL must hold open and service. Before you raise the pool size, check the maximum connection limit on the database server and what else shares it, such as other Metabase nodes, backup jobs or internal tools. A pool that is larger than the database can accept will fail in a different way, with connection errors rather than slow pages. Confirm the limit and headroom with your database team before you change the setting.

Application database docs

Warehouse query concurrency rises

A larger pool for a data source lets Metabase run more queries against the warehouse at the same time. Ten dashboards that once queued can now hit the warehouse together, which can saturate compute, exhaust warehouse-side connection limits or push up your bill on pay-per-query platforms. Review concurrency limits on the warehouse side, workload management queues and any per-user quotas. Measure warehouse load before and after the change, not only Metabase response times.

Memory pressure from more threads

Each additional Jetty thread handles requests and holds memory for them, and the JVM heap must absorb the extra query results and session state those threads produce. More threads without more heap can turn a slow instance into one that runs out of memory and restarts. Change thread counts and heap size together, and watch garbage collection and heap usage under peak load. Heap sizing is covered in its own topic, so plan both changes in the same test window.

Migration locks during cluster upgrades

Metabase runs application database migrations automatically during upgrades, and the upgrade docs recommend reducing a cluster to a single node for major upgrades because of a migration lock. Larger pools on several nodes can keep more sessions open during that window and complicate the switch back to one node. Plan the upgrade with pool settings at their original values, confirm that the old nodes are stopped, and take the application database backup first. Rolling back means restoring that backup or running the migrate down command with the newer JAR.

Upgrading Metabase docs

Credential and network exposure

Additional connections multiply the places where database credentials are used, logged or stored. Each new Metabase node or pool needs a network path to the database and must authenticate with an account that has only the privileges it needs. Review firewall rules, TLS on database connections and the account used for the App DB and each warehouse connection. Confirm that connection strings and passwords stay out of logs and shared configuration files, and that database accounts can be rotated without an outage.

Monitoring gaps after tuning

Once a pool is larger, the usage figures you relied on before can mislead you. A log line showing connection usage such as 12/15 tells you the pool size and current use, but it does not show queue wait time, slow queries or warehouse-side saturation. Record pool usage, Jetty thread use and response times before the change, then compare them at peak after the change. Set alerts for sustained pool saturation so that a full pool is found before users report that Metabase is unresponsive.

Environment variables docs

Questions buyers ask about tuning Metabase pools and threads

What does tuning Metabase connection pools and threads cost, and who gets paid?

The cost is the labor to read the pool and thread signals, test changes under realistic load, and document the settings you land on. If you buy it, you pay a partner for that scoped work in a fixed-scope engagement, and the quote follows from a written scope that names the environments, logs and load tests included. Your team also carries a cost you may not price separately: time from database and platform administrators who grant access and approve changes. Ask for the quote to list what is one-time (diagnosis, tuning, documentation) and what recurs (retainer support, re-testing after Metabase upgrades or traffic growth). Costs go up with more instances, more databases, and slower change windows.

How long does diagnosing and tuning Metabase pools usually take?

The duration depends on what drives the work: how many Metabase nodes share one application database, how many databases Metabase queries, how often the pool reaches its limit, and whether you can run a repeatable load test. Collecting logs over a representative period takes time before any change is made, and each tuning cycle needs a monitored window to confirm the effect. Environments with a change freeze or a single approved maintenance slot take longer. Ask any provider for a timeline tied to these inputs and to the number of tuning cycles the scope includes, rather than a fixed promise.

What does my team need to provide before tuning starts?

Start with the Metabase logs that show application database connection usage, because those lines are the baseline for every decision. Add a description of the expected load: who uses dashboards, when peaks occur, and which embedded or scheduled workloads run. You will also need the Metabase version, the deployment layout (number of nodes, reverse proxy, container or JAR setup), and the current values of the pool and thread settings. Provide read access to the application database host and to the warehouse metrics you use to watch query load, plus a test environment or agreed window for load testing. Confirm each item in writing before work starts.

Can an internal team tune Metabase pools and Jetty threads on its own?

Yes, if the team can read logs, change environment variables, restart Metabase in a controlled way, and run repeatable load tests. The main risk is changing several limits at once, which hides cause and effect, or raising the application database pool without checking that the database server can accept the extra connections. Internal teams usually need a clear baseline, a single change at a time, and a rollback plan. A partner adds the most value when the team lacks load-testing skills, the platform is business critical, or the same question keeps returning after upgrades and growth.

Does upgrading to a paid Metabase plan change pool or thread settings?

Based on the plan facts available here, paid plans add features such as SSO, row and column permissions, and auditing, and they do not change how connection pools or Jetty threads are sized. Confirm this with Metabase for your specific plan and version before you assume it, because edition differences can change over time. Any pool tuning you do on the open source edition still applies after you upgrade, so the work is not wasted. Ask Metabase which settings, if any, differ by plan, and retest after a plan change if you adopt features that add load.

How do I read App DB connection usage in the Metabase logs?

Metabase logs report application database connection usage as a fraction, such as 12 used out of 15 available. When that fraction stays at or near the maximum during normal activity, requests wait for a free connection, and Metabase can become slow or unresponsive. Read the pattern over time rather than a single line: note when usage peaks, which dashboards or scheduled jobs coincide with it, and whether it drops after load falls. Compare these readings with response times you see in the browser before changing any limit. The environment variables reference lists the settings that control these pools.

When should we bring in an outside partner for Metabase performance tuning?

Consider a partner when pool exhaustion recurs after you have already raised limits, when slowness appears only at peak times and you cannot reproduce it, or when the change could affect a regulated or customer-facing service. A partner is also useful when you need documented settings for audit or change management, or when upgrades and new embedded workloads keep reopening the question. DeployOpen plans, implements and supports self-hosted open-source platforms in your own infrastructure, and most engagements are fixed-scope with a written scope agreed before work starts. Ask for a scope that names logs, load tests, change windows and the documentation you will keep.

How DeployOpen scopes and supports Metabase tuning

DeployOpen starts with the pool and thread readings from your own Metabase logs and a written scope for the tuning work. We then change settings in your environment, test under realistic load, and hand over the settings and the reasoning behind them. Engagements are fixed-scope, and ongoing support is available as a retainer.

How we scope

  • Collect current Jetty thread counts, application database pool usage and slow-page symptoms from your existing logs
  • Confirm the Metabase version, application database engine and warehouse drivers in use before proposing changes
  • Agree in writing which pool and thread settings may change, which environments are covered and what load test proves them
  • Record who in your team approves configuration changes and who owns the warehouse side of the connection limits

How we build

  • Set Jetty thread and application database pool values in your deployment config, one change at a time, with the reason recorded
  • Check that warehouse connection limits and database user quotas can absorb the pool sizes you choose
  • Run repeatable load tests that mirror your peak dashboard and embed traffic, then compare pool usage before and after
  • Review the Metabase environment variable settings that interact with the pool and thread values for your deployment

How we hand over

  • Deliver a written configuration record with each value, its default, the tested value and the load profile behind it
  • Document the log lines to watch for pool usage and the thresholds that should trigger a review
  • Walk your platform and database owners through the runbook for raising limits safely during an incident
  • Provide a rollback procedure that restores the previous settings and confirms Metabase has restarted cleanly

How we support

  • Re-check pool usage and thread counts after Metabase upgrades, new data sources or a change in user volume
  • Retest the tuned settings when the warehouse, network path or deployment platform changes
  • Offer ongoing support and continuous testing as a retainer, scoped in writing with your team
  • Keep the configuration record current so your team can review changes during internal audits

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.