-
Notifications
You must be signed in to change notification settings - Fork 13
Configuration
cloudlinux edited this page Apr 10, 2013
·
2 revisions
MySQL Governor configuration is located in /etc/container/mysql-governor.xml It is best to modify it using dbctl tool.
Once configuration file is updated, please, restart the governor using: $ service db_governor restart
Example configuration:
<governor> <!-- on - governor works in LVE mode. In that mode, users that use above limit amount of resources will be placed inside a single LVE --> <!-- off - governor works in DB DISABLE mode, when restricted users will not be able to connect to MySQL until unrestricted --> <!-- Current user's request will be killed on restrict --> <!-- To change resource usage of restricted user in LVE mode use command /usr/sbin/lvectl set 3 --cpu=<new value> --ncpu=<new value> --io=<new value> --save-all-parameters --> <lve use="on/off"/> <!-- connection information --> <!-- If host, login and password are not present, this information is taken from /etc/my.cnf and ~root/.my.cnf --> <!-- Use symbol specified in prefix to figure out hosting accounts (mysql username will be split using prefix_separator, and first part will be used as account name). If prefix is not set, or empty -- don’t use prefixes/accounts --> <!-- db governor will try to split MySQL user names using prefix separator (if present) and statistics will be aggregated for the prefix (account name) --> <connector host="..." login="..." password=".." prefix_separator="_"/> <!-- reset history after restrict --> <!-- Intervals define historical intervals for burstable limits. In seconds --> <intervals short="5" mid="60" long="300"/> <!-- log all errors/debug info into this log --> <log file=”/var/log/dbgovernor-error.log” mode=”DEBUG|ERROR”/> <!-- s -- seconds, m -- minutes, h -- hours, d -- days --> <!-- on restart, restrict will disappear --> <!-- log file will contain information about all restrictions that were take --> <!-- if user hits any of the limits during period of time specified in timeout, higher level of restrict will be used to restrict user. If user was already on level4, level4 will be applied again --> <!-- attribute format set an restrict log format: SHORT - restrict info only MEDIUM - restrict info, _all_tracked_values_ LONG - restrict info, _all_tracked_values_, load average and vmstat info VERYLONG - restrict info, _all_tracked_values_, load average and vmstat info, slow query info --> <!-- script -- path to script to be triggered when account is restricted --> <!-- user_max_connections - The number of simultaneous connections of blocked user (in LVE mode) --> <!-- killuser -- kill current queries on restrict, as we cannot throttle them --> <restrict level1="60s" level2="15m" level3="1h" level4="1d" timeout="1h" log="/var/log/dbgovernor-restrict.log" format="SHORT|MEDIUM|LONG|VERYLONG" script="/path/to/script" user_max_connectins="30" killuser="on"/> <!-- Enable or disable saving of statistics for lve-stats - On - enabled, Off-disabled --> <statistic mode="on"></statistic> <!-- Enable logging user queries on restrict, can be On or Off --> <!-- Files saves in /var/lve/dbgovernor-store and be kept here during 10 days --> <logqueries use="on"></logqueries> <default> <!-- kill user’s query, prevent from running any other queries for X period of time --> <!-- -1 not use limit(by default, current - required) --> <limit name="cpu" current="150" short="100" mid="90" long="65"/> <limit name="read" current="100000000" short="90000000" mid="80000000" long="70000000"/> <limit name="write" current="100000000" short="90000000" mid="80000000" long="70000000"/> </default> <!-- name will matched account name, as extracted via prefix extraction --> <!-- mysql_name will match exact MySQL user name. If both name and mysql_name are present, system will produce error --> <!-- mode restrict -- default mode, enforcing restrictions --> <!-- mode norestrict -- track usage, but don’t restrict user --> <!-- mode ignore -- don’t track and don’t restrict user --> <user name=”xxx” mysql_name=”xxx” mode=”restrict|norestrict|ignore”> <limit...> </user> </governor>