Add Max Concurrent Connections for database users

Closes #1849

Allows database users to be limited to a number of concurrent connections to prevent one user from connecting hundreds of time and bottlenecking the MySQL server.
This commit is contained in:
AreYouScared 2020-04-22 06:00:04 -04:00
parent 2c3a9228ec
commit f0e4764a11
10 changed files with 56 additions and 6 deletions

View file

@ -30,7 +30,7 @@ class Database extends Model
* @var array
*/
protected $fillable = [
'server_id', 'database_host_id', 'database', 'username', 'password', 'remote',
'server_id', 'database_host_id', 'database', 'username', 'password', 'remote', 'max_connections',
];
/**
@ -51,6 +51,7 @@ class Database extends Model
'database_host_id' => 'required|exists:database_hosts,id',
'database' => 'required|string|alpha_dash|between:3,100',
'username' => 'string|alpha_dash|between:3,100',
'max_connections' => 'string',
'remote' => 'required|string|regex:/^[0-9%.]{1,15}$/',
'password' => 'string',
];