Connection Management
Monitor and control active connections to keep your database stable, fast, and secure.
Overview
Databases have a maximum number of concurrent connections they can handle. Too many connections can cause slow queries, timeouts, and in some cases service downtime. RunxBuild provides connection controls so you can keep usage predictable and protect your instance.
Recommended Setup: Use connection pooling in your application and set sensible limits per user or service to prevent connection spikes.
Viewing Active Connections
In the database dashboard, the Connections panel shows your live connection usage and helps you identify spikes quickly.
- Total active connections
- Connections by user
- Idle vs active sessions
- Long-running connections
Common Causes of Spikes: Missing pooling, too many app replicas, background workers opening new connections, or leaked connections not being released properly.
Setting Connection Limits
You can configure a maximum connection limit for your database and optionally enforce per-user limits to prevent a single app from consuming all available connections.
- Open your database instance
- Go to Settings → Connections
- Set Max Connections and save changes
Idle Timeout
Idle connections waste resources and can block legitimate traffic. Use idle timeouts to automatically clear inactive sessions and keep the database responsive under load.
Why It Matters: If your app opens connections and doesn’t release them, you can hit the maximum limit even with low traffic. Idle timeout policies help protect against this.
Terminating Connections
If you encounter a connection spike, stuck query, or runaway client, you can terminate active sessions from the dashboard. This is useful for recovering quickly without restarting the database.
Safe Use Case: Terminate idle sessions or connections from a misconfigured service that is rapidly reconnecting and exhausting the database limits.
Best Practices
- Use connection pooling (recommended for all production apps)
- Set per-service connection limits to prevent noisy neighbors
- Monitor spikes after scaling replicas
- Terminate only suspicious, idle, or runaway sessions
- Rotate credentials if you suspect unauthorized access