[MDEV-18252] Can't decrease max_connections below 10 Created: 2019-01-15 Updated: 2023-09-04 Resolved: 2019-06-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation, Server, Variables |
| Affects Version/s: | 10.1.33, 10.2.15, 10.3.6, 10.3.10, 10.2.21, 10.3.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Karl Levik | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Setting max_connections to 1 is possible on MySQL 5.7 and 8.0, but doesn't work with recent versions of MariaDB. The documentation seems to indicate it should work as it gives the range from 1 to 100000.
(I've tagged the specific versions I've tested, but it's obviously likely to affect other 10.2 and 10.3 versions as well.) |
| Comments |
| Comment by Elena Stepanova [ 2019-01-16 ] | ||||||||||||||||||||
|
Thanks for the report.
The documentation needs to be updated. | ||||||||||||||||||||
| Comment by Karl Levik [ 2019-01-17 ] | ||||||||||||||||||||
|
I must admit I struggle to see the reasoning behind this change. max_connections < 10 may not be a sensible choice in a typical production environment, but there could be use-cases you're not accounting for, and MariaDB is also used in dev/testing environments where requirements can be different. So why limit the range of this variable? Possible use-case: setting max_connections = 1 as a quick way to lock the database for other users while doing database schema updates. | ||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-01-17 ] | ||||||||||||||||||||
|
monty, do you want to clarify? | ||||||||||||||||||||
| Comment by Ian Gilfillan [ 2019-01-18 ] | ||||||||||||||||||||
|
Documentation has been updated. | ||||||||||||||||||||
| Comment by Michael Widenius [ 2019-01-25 ] | ||||||||||||||||||||
|
I changed the limit to ensure that a user doesn't do anything wrong by accident. There is no reason to assume that an application will only make one connection to the database. Another issue, is that if you do anything wrong with one connection (starting a long transaction), there In practice, limiting the connection to 1, may cause unexpected results for the user, so I thought it's better to avoid the issue. | ||||||||||||||||||||
| Comment by Karl Levik [ 2019-02-04 ] | ||||||||||||||||||||
|
I suppose that makes sense - thank you for the explanation! | ||||||||||||||||||||
| Comment by Ian Gilfillan [ 2019-06-10 ] | ||||||||||||||||||||
|
Closing as documentation updated, no other issue. | ||||||||||||||||||||
| Comment by Karl Levik [ 2023-08-22 ] | ||||||||||||||||||||
|
Thought I should add that in PostgreSQL in addition to max_connections they have a system variable superuser_reserved_connections. Perhaps that could be an idea for MariaDB as well. | ||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-09-04 ] | ||||||||||||||||||||
|
MariaDB always have one reserved connection for a superuser. Additionally it can listen on a separate port, it'll be available even when max_connections limit is reached |