Connection Throttling
(MXS-764)
|
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Core |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.0 |
| Type: | Sub-Task | Priority: | Major |
| Reporter: | Joffrey MICHAIE (Inactive) | Assignee: | martin brampton (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2016-12, 2016-13, 2016-14 | ||||||||
| Description |
|
Hi, it would be great to have a throttling feature in Maxscale, to avoid using too many connections in the backend, and to avoid sending connection errors to applications (up to some level) Scenario: When 100 connections are opened, the following will be waiting for a free slot, not returning max_connection error to client. Thanks in advance! |
| Comments |
| Comment by Dipti Joshi (Inactive) [ 2015-06-02 ] |
|
|
| Comment by martin brampton (Inactive) [ 2015-06-03 ] |
|
Who has reviewed the feasibility of this? |
| Comment by Joffrey MICHAIE (Inactive) [ 2015-06-03 ] |
|
Hi, thanks for the answers ! The goal is not to refuse applications connections with an error, when the mysql/mariadb connections are fully used. Example similar in other popular lb software: Hope this helps, |
| Comment by martin brampton (Inactive) [ 2015-06-05 ] |
|
Thanks for the comment, Joffrey. I can see the attraction in principle, but have concerns over the practical implications in the software. Until the relevant router has been invoked (and there is an increasing number of different routers with different behaviours, plus we have the option of hierarchical routing where one router forwards to another router) MaxScale does not know which backend database server will be involved. It is therefore difficult (at the least) to know how to handle connection buffering prior to routing. Once routing has been involved, there is a quite complex set of data structures in play, and buffering these for later processing does not look straightforward. I am surprised that a feature of this complexity that has been nominated as minor priority would be allocated to a release prior to any evaluation (that I know of) of the volume of work required. The basis for the issue is that MaxScale is a lot more general than typical lb software. |
| Comment by Joffrey MICHAIE (Inactive) [ 2015-08-21 ] |
|
Thanks Martin for the analysis. Maybe it would be great to start with simple things, like limiting connections or implementing this throttling on the listener side ? Something like: [RW Split Listener] Those new parameters would affect connections on the MaxScale backend directly (and indirectly on the MySQL/MariaDB Backends). Currently, as far as I experience from the field, most of the maxscale users don't use complex routing/filtering, but simple round-robin or rw split. What do you think ? Joffrey |
| Comment by Johan Wikman [ 2016-03-01 ] |
|
Removing fix version of 1.4. |
| Comment by Dipti Joshi (Inactive) [ 2016-03-31 ] |
|
Removed it from 1.5.0 for now. |
| Comment by martin brampton (Inactive) [ 2016-05-31 ] |
|
Development has progressed, and there is now logic to handle the imposition of a limit on the number of connections to be accepted by MaxScale on a particular service. The logic is also in place to put a specified number of connections into a queue, after the limit has been reached. The logic does not exist to insert the queued connection requests back into active use. Given timescales, the current aim is to tidy up the limitation on number of connections, but to exclude queuing of connection requests for future development. |
| Comment by martin brampton (Inactive) [ 2016-06-01 ] |
|
The limiting functionality is now operational, based on e.g. "max_connections=25" in the configuration of a service. After the specified number of connections have been made, a request for a connection will receive the standard error reply, 1040 Too many connections. NOTE: without the mysql library, there is no practical way to translate the error message into a local language, it is hard coded as English. |
| Comment by martin brampton (Inactive) [ 2016-06-14 ] |
|
Incorrect comparison fixed to stop limit being one higher than specified. The max_connections limit on a service is the functionality to be released in version 2.0. There is currently code under test that queues up requests beyond the connection limit and times them out after the specified limit (subject to the granularity of the housekeeper). Functionality for processing the queue as connections become available requires further work, although the principles are established. |