Added max connection check#2
Conversation
gleamicus
left a comment
There was a problem hiding this comment.
Really happy to see this getting some use! This looks good, but I've added some notes with a few tweaks to make it more flexible for other users (if there are any).
| After=mariadb.service | ||
|
|
||
| [Service] | ||
| ExecStart=/usr/bin/mysqlchk |
There was a problem hiding this comment.
We should probably have a way to pass arguments to mysqlchk so people can override the default settings. How about using EnvironmentFile and passing something like $MYSQLCHK_ARGS on this line.
We should also drop privileges to nobody or something, there's no reason for this to run as root.
| return | ||
| } | ||
|
|
||
| if maxConn <= (connUsed + 10) { |
There was a problem hiding this comment.
Let's add runtime flags for this feature. Either one to enable connection count checking and another to set the limit (10 by default), or just a limit (0 by default, meaning the check is disabled).
Added max connection check