dbctl

Navigation:  MySQL Governor > Command Line Tools >

dbctl

Previous pageReturn to chapter overviewNext page

usage: dbctl command [parameter] [options]

 

commands:

 

set        set parameters for a db_governor

list        list users & their limits. It will list all users who had been active since governor restart,
 as well as those for who explicit limits were set

list-restricted        list restricted customers, with their limits, restriction reason, and time period they will still be restricted

ignore        ignore particular user

watch        start observing particular user again

delete        remove limits for user/use defaults

restrict        restrict user using lowest level (or if --level specified, using the specified level)

unrestrict        unrestrict username (configuration file remains unchanged)

unrestrict-all        unrestrict all restricted users (configuration file remains unchanged)

--help        show this message

--version        version number

--lve-mode        set DB Governor mode of operation. Available values: off|abusers|all|single|on

                                 off - monitor only, don't throttle

 abusers - when user reaches the limit, put user's queries into LVE for that user (experimental)

 all - user's queries always run inside LVE for that user (experimental)

 single  - single LVE for all abusers.

 on - same as single (deprecated)

 

 

parameters:

 

default        set default parameter

usrename        set parameter for user

 

options:

 

--cpu=N        limit CPU   (pct)  usage

--read=N        limit READ  (MB/s) usage

--write=N        limit WRITE (MB/s) usage

--level=N        level (1,2,3 or 4) specified (deprecated) - this option is available only for period mode:

 

<restrict_mode use="period"/> (see http://docs.cloudlinux.com/index.html?mysql_governor_configuration.html)

 

The default mode is the "limit" - when a user hits limits, the account will be marked as restricted and if the user does not hit the limit again during "unlimit=1m" account will be unrestricted. This mode doesn't have any additional levels/penalties.

<restrict_mode use="limit" unlimit="1m"/>

 

Changing the "unlimit" can be done only via the configuration file (see http://docs.cloudlinux.com/index.html?mysql_governor_configuration.html).

--slow=N                limit time (in seconds) for long running SELECT queries

 

Options for parameter list:

 

--kb                     show limits in Kbytes no pretty print

--bb                     show limits in bytes no pretty print

--mb                     show limits in Mbytes no pretty prin

 

Examples:

 

$ dbctl set test2 --cpu=150,100,70,50 --read=2048,1500,1000,800

 

sets individial limits for cpu(current, short, middle period) and read(current, short, middle, long periods) for user test2

 

$ dbctl set default --cpu=70,60,50,40

 

changes default cpu limits.

 

All new limits will be applied immediately

 

To unrestrict user:

 

$ dbctl unrestrict username

 

To unrestrict all users:

 

$ dbctl unrestrict-all 

 

To restrict user:

 

$ dbctl restrict dbgov

 

To restrict user to level 2 restriction:

 

$ dbctl restrict dbgov --level=2

 

To make governor to ignore user:

 

$ dbctl ignore username

 

Delete user's limits, and use defaults instead:

 

$ dbctl delete username

 

Show limits as bytes:

 

$dbctl list --bb