MySQL Governor and placing queries inside users LVE

Starting from MySQL Governor version 1.0+, the govenror contains two modes of operation that allows to run users queries inside their LVE.

 

The Abusers mode: Once governor detects user going over the limits specified in MySQL Governor, all customer’s queries will execute inside that user’s LVE.

The All mode: The benefits of this approach is that limits are applied to both PHP & MySQL at the same time, all the time, preventing any spikes whatsoever. This way there are no need for separate limits for MySQL. Depending on overhead we see in the future, we might decide to use it as a primary way of operating MySQL Governor. We believe this mode will help with the condition when the site is still fast, but MySQL is slow (restricted) for that user. If someone abuses MySQL, it will cause queries to share LVE with PHP processes, and PHP processes will also be throttled, causing less of a new queries being sent to MySQL.

The mode of operation could be specified with dbctl tool, for example:

Both modes are experimental, they require correct dbname <=> username mapping with /etc/container/dbuser-map file. It is automatically generated on cPanel server (currently that is only one fully supported panel for these modes).

The format of the file is:

The file is checked for modifications every 5 minutes, if you need to apply changes immediately – just restart db_governor service.

 

Leave a Reply

Your email address will not be published. Required fields are marked *