MySQL Size Limit for Customers

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
I am currently using CloudLinux with MySQL governor and MariaDB 10.1. Is there a way to limit all of our clients MySQL size to a specific size, or even the possibility to size it according to the package?

It does not seem reasonable to allow people to have a 10 GB MySQL database. Is this maybe tied to the user disk space limit?

Screen Shot 2017-03-19 at 10.57.24 PM.png
 

A Hartonian

Active Member
May 22, 2018
44
9
8
Oman
cPanel Access Level
DataCenter Provider
This is probably an old post. But I am wondering how can I set a limit for mysql database size for customers. Sometimes we have users who abuses the hell out of the account. Their disk is 30GB which 2 GB is their website files and 15GB their database. This usage is intense for a shared server. Such scenario, 9 out of 10 are abusers. Usually feed reader websites that constantly post stuff from other websites. (Which is against our terms of use)

Anyways, sometimes it gets out of hand. If its possible to set a size limit for the database most of troubles are resolved automatically. Legit users will never exceed 400 to 800 MB of database size on shared environment.

In the past I've seen some hosters set this limit with cPanel but it seems I can't find any worthy documentation that offers such hack or solution.

My Setup is:
  • cPanel Dedicated
  • CloudLinux
  • Litespeed
  • Imunify360
  • Jetbackup
  • OSM
I would appreciate if anyone can advice on this matter. (specially @cPanelLauren who is always helpful)
 
  • Like
Reactions: cPanelLauren

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
Hey there, @A Hartonian

@cPanelLauren has taken a different position with the company and doesn't reply to forums stuff as much anymore, but I'll be happy to help!

There currently isn't a way to limit the size of the database content alone in cPanel. If the user has a 30G account, they can use all 30G for the databases.

There's an older feature request here:


but it has only received 6 votes in 4 years.

I'm sorry I don't have a method to implement this behavior for you at this time, but you're welcome to comment on that feature request to ask for an update.
 
  • Like
Reactions: cPanelLauren

Handssler Lopez

Well-Known Member
Apr 30, 2019
72
22
8
Guatemala
cPanel Access Level
Root Administrator
Hey there, @A Hartonian

@cPanelLauren has taken a different position with the company and doesn't reply to forums stuff as much anymore, but I'll be happy to help!

There currently isn't a way to limit the size of the database content alone in cPanel. If the user has a 30G account, they can use all 30G for the databases.

There's an older feature request here:


but it has only received 6 votes in 4 years.

I'm sorry I don't have a method to implement this behavior for you at this time, but you're welcome to comment on that feature request to ask for an update.
would there be a way to configure the restriction on the database space through CloudLinux LVE Manager? Is it possible through the interface or would any particular configuration be required? what do you think @CloudLinux Skhristich
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,028
313
cPanel Access Level
Root Administrator
CloudLinux has the MySQLGovernor tool here:


but that is designed for monitoring usage and queries, and doesn't deal with disk space.

There are other problems to consider when limiting disk usage based on database activity. If you are going to impose a limit, you'll need to avoid corruption, as the user will likely be writing to MySQL when that limit is reached. You'll also need to consider that this limit could take a site offline, or keep it from updating properly if the database access is restricted.

I know it's something the developers think about, but there isn't an ideal way to implement it at this time that would likely make all users and admins happy.
 

CloudLinux Skhristich

Well-Known Member
Verifed Vendor
May 23, 2019
66
37
18
kiev
cPanel Access Level
Root Administrator
Hi everyone,
Thanks @cPRex
Yes, @cPRex is right, MySQL Governor allows to restrict customers who use too many resources. It supports the following only limits:

CPU%CPU speed relative to one core. 150% would mean one and a half cores
READbytesbytes read. Cached reads are not counted, only those that were actually read from disk will be counted
WRITEbytesbytes written. Cached writes are not counted, only once data is written to disk, it is counted