firstworks SQL Relay - Throttling

Throttling

Throttling limits the number of connections to a given database and queues clients rather than denying them access outright. This can maximize the value of a per-connection licensing scheme and preventing database overload.

Per-Connection Licensing Schemes

Throttling is especially helpful when migrating from an in-house database to a cloud-service database with a per-connection licensing scheme. Your in-house databae may have allowed any number of connections, but you may only be able to afford a certain number of connections to the cloud.

SQL Relay can be configured to open the exact number of connections that you paid for and funnel all of your database traffic through them. If you paid for 10 connections, but every now and then you get a burst of traffic and 15 clients need to connect, 5 of them will be queued rather than rejected.

Database Overload

"Too many connections." is a common error seen by MySQL users.

All too often it isn't seen until the app has been in production for a long time and finally got enough traffic to overload the database.

A burst of activity finally caused the app to try to open more connections than the database could handle. Unfortunately the app wasn't written to manage that particular error, so it just failed and printed the error out on the web page.

Perhaps the database could be tuned to allow more connections. Most likely though, the app only gets busy under certain circumstances and it would be nice if it could just be throttled back. It's also possible that the database has already been tuned up as far as it can go but still gets hammered from time-to-time.

SQL Relay can be configured to maintain a certain number of database connections and open more, on-demand, up to a point. If the app is so busy that it needs more connections than the maximum number configured, clients will be queued, rather than rejected. The queued clients consume few system resources and may be configured to wait for a while before giving up, or wait indefinitely.