Connections By Database

Overview

The Connections by Database report takes the instance’s current connection count and splits it by the database each connection is pointed at. It is a half pie over a three column grid, and every slice and every row opens the database level Connections report for that database, which is where the individual sessions are.

The Connections by Database report
Current connections, split by database.

It answers one question: an instance level connection number moved, so which application was it. Connection counts are one of the few instance figures where the total on its own is nearly useless, because the total is the sum of every pool on every application server.


Where to find it

Route How
Server Overview page The Connections panel – click the chart, or the Open Connections by Database link
Performance Dashboard The connections panel

The page title reads Connections By Database for <server name>.


Requirements

  • A connection to the instance, and permission to read the session list.
  • Nothing is installed on the monitored instance and nothing is stored.

Only user sessions are counted. Session ids of 50 and below are the engine’s own, and are excluded, so the numbers here are people and applications rather than internal tasks.


Reading the report

Connections split by database
One row per database, sized by how many distinct sessions are pointed at it.
Column What it is
Row Row number, largest first.
Database The database the connections are pointed at.
Connections How many distinct user sessions have it as their current database.

The database a connection is pointed at is where it currently is, not where it does its work. A connection opened against master that runs three-part-named queries against a user database is counted against master. So is one whose connection string names no database at all and inherits the login’s default. This matters when a row shows up under a database nobody believes anything connects to.

Gesture Result
Click a slice Opens Connections for that database
Double-click a grid row The same

How to read the report

  1. Look at the largest slice. Compare it with what you know about the applications on this instance.
  2. Look for a database with far more connections than it should have. A connection pool that has grown past its expected size is usually an application holding connections open through a slow call, not an application under load.
  3. Look for connections against system databases. Anything more than a handful against master is usually a connection string with no Initial Catalog.
  4. Click through to Connections for the database in question to see who, from where, and whether they are doing anything.

Common patterns

A pool at exactly its maximum size. The application is at its pool limit and new requests are queueing before they ever reach SQL Server. The instance looks quiet and the application looks slow.

A steadily climbing count for one database. Connections not being returned to the pool – usually an unclosed connection somewhere in a code path that only runs occasionally.

A large master slice. Connection strings without a database named. Harmless, but it means the counts for the real databases are understated.

Many databases with one or two connections each. Normal on a shared instance, and normal for monitoring tools, which connect to everything.


Where the data comes from

The instance’s current session list, grouped by current database, counting distinct session ids above 50. Nothing is stored.

It is a snapshot. Connection counts move constantly, and this report shows the moment it ran. The Connections panel on the Server Overview shows the same number over time, which is the better view for whether a count is climbing.


Report Why you would go there
Connections (database level) The drill down – the individual sessions on one database.
Connections (instance level) Every connection to the instance, with client address and auth scheme.
Sessions What those connections are actually running.
What is Active The requests running right now.
Blocking Tree Whether the connections are piling up behind each other.

Frequently asked questions

Why is the total lower than the connection count on the Server Overview panel? This report counts distinct user sessions with a current database. Sessions at or below id 50 are the engine’s own and are excluded.

Why does a database I do not use have connections? Either connection strings that do not name a database and fall back to a default, or a tool that connects to everything. Open Connections for that database to see who.

Does one connection mean one user? No. Application connection pools hold connections open whether or not anybody is using them, so a pool of fifty connections may be serving nobody at all at the moment you look.