Skip to content

Commit 47fbc2c

Browse files
authored
Merge pull request #373 from NikolayVoina/docs/tidy-governor
docs: governor: correct configuration and command references
2 parents 4426a5b + 664a3f9 commit 47fbc2c

3 files changed

Lines changed: 51 additions & 47 deletions

File tree

‎docs/cloudlinuxos/cloudlinux_os_components/README.md‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ More details of the governor operation modes are described in the [Modes of oper
33523352
|<span class="notranslate"> READ </span> | bytes | bytes read. Cached reads are not counted, only those that were actually read from disk will be counted|
33533353
|<span class="notranslate"> WRITE </span> | bytes | bytes written. Cached writes are not counted, only once data is written to disk, it is counted|
33543354
3355-
You can set different limits for different periods: current, short, med, long. By default those periods are defined as 1 second, 5 seconds, 1 minute and 5 minutes. They can be re-defined using [configuration file](./#configuration-and-operation). The idea is to use larger acceptable values for shorter periods. Like you could allow a customer to use two cores (200%) for one second, but only 1 core (on average) for 1 minute, and only 70% within 5 minutes. That would make sure that customer can burst for short periods of time.
3355+
You can set different limits for different periods: current, short, mid, long. By default those periods are defined as 1 second, 15 seconds, 1 minute and 5 minutes. They can be re-defined using [configuration file](./#configuration-and-operation). The idea is to use larger acceptable values for shorter periods. Like you could allow a customer to use two cores (200%) for one second, but only 1 core (on average) for 1 minute, and only 70% within 5 minutes. That would make sure that customer can burst for short periods of time.
33563356
33573357
Customers will also be limited to a finite number of concurrent connections, this number is 30 by default and can be changed. This is done so they wouldn't use up all the MySQL connections to the server. <span class="notranslate"> MySQL Governor </span> can also kill off slow <span class="notranslate"> SELECT </span> queries.
33583358
@@ -3366,7 +3366,7 @@ Before any SQL request, MySQL Governor determines which user sent the request an
33663366
33673367
This is how common server resources can be managed.
33683368
3369-
#### Why the СPU/IO charts are different for database and LVE usage?
3369+
#### Why the CPU/IO charts are different for database and LVE usage?
33703370
33713371
SQL requests are not limited inside LVE, so there are not any calculations for IO usage there. It can be clearly viewed via the lve-stats charts:
33723372
@@ -3632,7 +3632,7 @@ Example configuration:
36323632
<!-- 'all' - user's queries always run inside LVE for that user -->
36333633
<!-- 'single' - single LVE=3 for all abusers. -->
36343634
<!-- 'on' - deprecated (old restriction type) -->
3635-
<!-- 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 -->
3635+
<!-- To change resource usage of restricted user in LVE mode use command /usr/sbin/lvectl set 3 --speed=<new value>% --io=<new value> --save-all-parameters -->
36363636
<lve use="on|single|off|abusers|all"/>
36373637

36383638
<!-- connection information -->
@@ -3643,16 +3643,16 @@ Example configuration:
36433643
<connector host="..." login="..." password=".." prefix_separator="_"/>
36443644

36453645
<!-- Intervals define historical intervals for burstable limits. In seconds -->
3646-
<intervals short="5" mid="60" long="300"/>
3646+
<intervals short="15" mid="60" long="300"/>
36473647

36483648
<!-- log all errors/debug info into this log -->
3649-
<log file=”/var/log/dbgovernor-error.log” mode=”DEBUG|ERROR”/>
3649+
<log file="/var/log/dbgovernor-error.log" mode="DEBUG|ERROR"/>
36503650

36513651
<!-- s -- seconds, m -- minutes, h -- hours, d -- days -->
36523652
<!-- on restart, restrict will disappear -->
36533653
<!-- log file will contain information about all restrictions that were take -->
36543654
<!-- timeout - penalty period when user not restricted, but if he hit his limit during this period he will be restricted with higher level of restrict (for more long time) -->
3655-
<!- level1, level2, level3, level4 - period of restriction user for different level of restriction. During this period all user's requests will be placed into LVE container -->
3655+
<!-- level1, level2, level3, level4 - period of restriction user for different level of restriction. During this period all user's requests will be placed into LVE container -->
36563656

36573657
<!-- 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 -->
36583658
<!-- attribute format set an restrict log format:
@@ -3687,9 +3687,8 @@ user_max_connections="30"/>
36873687
<limit name="cpu" current="150" short="100" mid="90" long="65"/>
36883688
<limit name="read" current="100000000" short="90000000" mid="80000000" long="70000000"/>
36893689
<limit name="write" current="100000000" short="90000000" mid="80000000" long="70000000"/>
3690-
<!-- Time to kill slow SELECT queries for account, can be different for accounts in seconds(but unit can be specified) -->
3690+
<!-- Time in seconds to kill slow SELECT queries for account, can be different for accounts. Specify a plain number: time units are not supported -->
36913691
<!-- enabled only when slow_queries run="on" -->
3692-
<!-- s -- seconds, m -- minutes, h -- hours, d -- days -->
36933692
<!-- Requests are checked at 15 second intervals, so a request will be canceled after a timeout + 15 seconds maximum -->
36943693
<limit name="slow" current="30"/>
36953694
</default>
@@ -3748,7 +3747,7 @@ If the `dbuser-map` file is absent on the server, the `abusers` mode emulates th
37483747
37493748
With the `single` and `abusers` mode, once user is restricted, the queries for that user will be limited as long as user is using more than limits specified. After a minute that user is using less, we will unrestricted that user.
37503749
3751-
You can specify modes of operation using [dbctl](/cloudlinuxos/command-line_tools/#dbctl) or by changing [configuration file](./#configuration-3).
3750+
You can specify modes of operation using [dbctl](/cloudlinuxos/command-line_tools/#dbctl) or by changing [configuration file](./#configuration-2).
37523751
37533752
#### MySQL Governor limits
37543753
@@ -3766,15 +3765,15 @@ Here they are:
37663765
* absolute values of the LVE limits
37673766
37683767
3769-
MySQL Governor allows setting the burstable limits for accounts. To provide that possibility, four levels of limits are defined: `current`, `short`, `middle`, and `long`. Correctly set limits can give users more CPU without having a bottleneck on MySQL.
3768+
MySQL Governor allows setting the burstable limits for accounts. To provide that possibility, four levels of limits are defined: `current`, `short`, `mid`, and `long`. Correctly set limits can give users more CPU without having a bottleneck on MySQL.
37703769
37713770
**General principles of choosing the limits**:
37723771
37733772
* `current` and `short` can be more than the LVE limit and should not be less
37743773
* setting the `current` and `short` limits more than the LVE limit prevents bottlenecks in SQL request processing
37753774
* `middle` limit can be more or less that the LVE limit
37763775
* `long` on the contrary, should not be more than the LVE limit
3777-
* setting the `middle` and `long` limits less than the LVE limit prevents abuse of other processes in the account (Apache, PHP) by MySQL
3776+
* setting the `mid` and `long` limits less than the LVE limit prevents abuse of other processes in the account (Apache, PHP) by MySQL
37783777
37793778
**Coefficients for calculating limits**
37803779
@@ -3784,18 +3783,18 @@ MySQL Governor limits should be calculated based on the corresponding LVE limits
37843783
37853784
| Limit level | Formula | Description |
37863785
|---|---|---|
3787-
| `current` | `LVE_CPUSPEED × 1` | Slightly above the LVE CPU limit to avoid bottlenecks |
3786+
| `current` | `LVE_CPUSPEED × 1` | Equal to the LVE CPU limit, to avoid bottlenecks |
37883787
| `short` | `LVE_CPUSPEED × 0.95` | Short-term burst allowance |
3789-
| `middle` | `LVE_CPUSPEED × 0.87` | Medium-term average |
3788+
| `mid` | `LVE_CPUSPEED × 0.87` | Medium-term average |
37903789
| `long` | `LVE_CPUSPEED × 0.75` | Long-term sustained maximum |
37913790
37923791
*IO limits:*
37933792
37943793
| Limit level | Formula | Description |
37953794
|---|---|---|
3796-
| `current` | `LVE_IO × 1` | Slightly above the LVE IO limit |
3795+
| `current` | `LVE_IO × 1` | Equal to the LVE IO limit |
37973796
| `short` | `LVE_IO × 0.83` | Short-term burst allowance |
3798-
| `middle` | `LVE_IO × 0.76` | Medium-term average |
3797+
| `mid` | `LVE_IO × 0.76` | Medium-term average |
37993798
| `long` | `LVE_IO × 0.59` | Long-term sustained maximum |
38003799
38013800
**How IO limits are calculated**
@@ -3812,7 +3811,7 @@ In the MySQL Governor configuration (`/etc/container/mysql-governor.xml`), the `
38123811
* If you face spike CPU consumption with these limits, it is recommended to reduce the excess of the `current` and `short` limits over the LVE limit. For example, to the values 150/110/100/90.
38133812
* If the average level of CPU consumption is too high, then it is recommended to reduce the `middle` and `long` limits, too. For example, to the values 150/100/80/50.
38143813
* Then MySQL processes will fall into LVE and be limited by LVE limits more often.
3815-
* The same clues are applicable to the IO limits – the `current` and `short` IO limits for MySQL Governor can exceed IO LVE limits, but the `middle` and `long` cannot.
3814+
* The same clues are applicable to the IO limits – the `current` and `short` IO limits for MySQL Governor can exceed IO LVE limits, but the `mid` and `long` cannot.
38163815
38173816
**Configuration example**
38183817
@@ -3997,7 +3996,7 @@ To install beta version of MySQL:
39973996
|mariadb101 | MariaDB v10.1|
39983997
|mariadb102 | MariaDB v 10.2|
39993998
|mariadb103 | MariaDB v 10.3 [requires <span class="notranslate"> MySQL Governor 1.2-36+; for cPanel - MySQL Governor 1.2-41+ </span> ]|
4000-
|mariadb104 | MariaDB v 10.4 [requires <span class="notranslate">MySQL Governor</span> 1.2-53+]||
3999+
|mariadb104 | MariaDB v 10.4 [requires <span class="notranslate">MySQL Governor</span> 1.2-53+]|
40014000
|mariadb105 | MariaDB v 10.5 [requires <span class="notranslate">MySQL Governor</span> 1.2-62+]|
40024001
|mariadb106 | MariaDB v 10.6 [requires <span class="notranslate">MySQL Governor</span> 1.2-76+]|
40034002
|mariadb1011 | MariaDB v 10.11 [requires <span class="notranslate">MySQL Governor</span> 1.2-103+]|
@@ -4057,7 +4056,7 @@ whmapi1 configureservice service=mysql enabled=1 monitored=0
40574056
```
40584057
</div>
40594058
4060-
The following script could be used before installing MySQL-governor and MySQL/MariaDB packages to create the backup:
4059+
After you install the `governor-mysql` package, and before you run `mysqlgovernor.py --install`, the following script could be used to create the backup:
40614060
<div class="notranslate">
40624061
40634062
```
@@ -4097,7 +4096,7 @@ dbctl --lve-improved-accuracy off
40974096
40984097
The calculation of CPU usage has become more accurate, so the `dbtop` utility provides more correct information to the MySQL Governor and it places user’s requests to the LVE in a proper moment. And as a result, such improvements reduce the possibility of absorbing whole server resources by one user.
40994098
4100-
One mpre possible outcome of calculation improvements is that some server users will become in need of MySQL Governor limits reconfiguration.
4099+
One more possible outcome of calculation improvements is that some server users will become in need of MySQL Governor limits reconfiguration.
41014100
41024101
#### How to view the impact of improvements?
41034102
@@ -4111,7 +4110,7 @@ In this case, CPU usage by database could be less than LVE average CPU usage (bl
41114110
41124111
**The new type of  CPU usage calculation is turned on**.
41134112
4114-
In this case, CPU usage by database become more similar to LVE average CPU usage (blue chart and green chart on the sceen):
4113+
In this case, CPU usage by database become more similar to LVE average CPU usage (blue chart and green chart on the screen):
41154114
41164115
![CPU Usage chart: green average and blue database lines track together near 100% below limit](/images/cloudlinuxos/cloudlinux_os_components/NewTurnedOn.webp)
41174116
@@ -4125,7 +4124,7 @@ Before any SQL request, MySQL Governor determines which user sent the request an
41254124
41264125
This is how common server resources can be managed.
41274126
4128-
#### Why the СPU/IO charts are different for database and LVE usage?
4127+
#### Why the CPU/IO charts are different for database and LVE usage?
41294128
41304129
SQL requests are not limited inside LVE, so there are not any calculations for IO usage there. It can be clearly viewed via the lve-stats charts:
41314130
@@ -4139,7 +4138,7 @@ This is the user’s real IO Database usage which was calculated by MySQL Govern
41394138
41404139
This is the user’s IO Database usage which was calculated by lve-stats.
41414140
4142-
Also for different types of database load (for example in case, there is a huge amount of shot requests), CPU usage charts for LVE and database can be different.
4141+
Also for different types of database load (for example in case, there is a huge amount of short requests), CPU usage charts for LVE and database can be different.
41434142
41444143
Take a look on this chart:
41454144
@@ -4193,7 +4192,7 @@ touch /etc/systemd/system/mariadb.service.d/limits.conf
41934192
```
41944193
</div>
41954194
4196-
3. Add the following content to the the file <span class="notranslate"> `/etc/systemd/system/mariadb.service.d/limits.conf` </span> :
4195+
3. Add the following content to the file <span class="notranslate"> `/etc/systemd/system/mariadb.service.d/limits.conf` </span> :
41974196
41984197
<div class="notranslate">
41994198

0 commit comments

Comments
 (0)