Because bit.io is serverless, connection lifetimes are finite. Details on the connection lifecycle are below:
- Free tier databases can have up to 50 simultaneous connections.
- Pro databases can have up to 1800 simultaneous connection.
- A connection with an open transaction for more than 5 minutes will be terminated (
- A connection that idles for more than 5 minutes (i.e., no queries are running, etc.), will be terminated (
- Any connection open longer than 60 minutes will terminate.
When a database has no connections, it will "cool down" after 60 seconds. The first new connection will warm it back up. There is a ~250ms warm up for the first connection after cool down. There is no connection delay otherwise (beyond standard SSL and authentication startup logic).
When a Pro database is under heavy load, it will autoscale its resources to match. During an autoscale event, connections may terminate.
During an outage event, databases become "cold" again. Reconnecting will "warm" it back up in a zone that isn't experiencing an outage.
Given the above, we recommend client-side connection pooling. Connection pools will automatically reconnect when a program needs a connection. Most programming languages support pooling. bit.io's python and node SDK have pooling built in.
Anti-patterns for connecting
Using mechanisms intended to circumvent cool downs such as creating empty keepalives or establishing unused connections may lead to throttling, disconnects, and/or additional usage fees. If you require custom connection lifecycles, contact [email protected] for our enterprise offerings.
Updated 25 days ago