A user has the ability to exhaust all the mysql connections.
By doing a "GRANT USAGE ON . TO 'user'@'localhost' WITH MAX_USER_CONNECTIONS 20" the number of connections can be limited.
MAX_USER_CONNECTIONS is a really old mysql settings and should be available on all mysql-5.0+ servers.
This would be helpful when they have their website slashdoted/vulnerability attack will have an effect on their site only and not all that are hosted.
I humbly request that this configuration option be added to the account plan settings to enable a consistent application though all hosted sites with granularity to provide a differentiated level of service.
Postgres has a similar capability -http://www.postgresql.org/docs/current/static/sql-createrole.html CONNECTION LIMIT too.
Comments
Submitted by andreychek on Thu, 03/19/2015 - 23:18 Comment #1
Howdy -- thanks for your suggestion!
I'm not saying "no", we'll see what Jamie says about that -- however, I'll offer that Virtualmin Pro offers a feature that may be able to accomplish something similar.
It offers resource restrictions, which can restrict a given user to N processes.
So what an admin could do is restrict a given user to say, 20 processes, which would also have the affect of preventing a given domain from being DoS'd since each request is associated with a running PHP process.
It looks like you're using Virtualmin GPL there, so you may not have access to that, but if you do have access to a Virtualmin Pro machine, you could set that in Administrative Options -> Edit Resource Limits.
You can also configure it using the Server Templates in the CPU and memory resource limits template.
Submitted by danblack on Thu, 03/19/2015 - 23:40 Comment #2
The pro account of my employer is where I'd like this so happy as a pro offering. Nice thought around process limits, should at least help with accidental single threaded applications. There is still the malicious DoS case where a php script is written to acquire many connections or a multithreaded event handler. Thanks for your quick and thoughtful response.
Submitted by JamieCameron on Fri, 03/20/2015 - 18:03 Comment #3
This feature already exists, although the limit is defined at the template level rather than the plan. You can set the MySQL connection limit for new users at System Settings -> Server Templates -> Default Settings -> MySQL Database -> Maximum connections for domain owners.
Submitted by danblack on Fri, 03/20/2015 - 18:34 Comment #4
Sorry I missed that one.