You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by br...@apache.org on 2019/02/05 02:17:06 UTC

[drill] branch gh-pages updated: edits to cgroup doc

This is an automated email from the ASF dual-hosted git repository.

bridgetb pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/gh-pages by this push:
     new e75fad2  edits to cgroup doc
e75fad2 is described below

commit e75fad22ad3225ed3e788f169ecba02b2440144c
Author: Bridget Bevens <bb...@maprtech.com>
AuthorDate: Mon Feb 4 18:16:21 2019 -0800

    edits to cgroup doc
---
 ...121-configuring-cgroups-to-control-cpu-usage.md | 72 +++++++++++-----------
 1 file changed, 37 insertions(+), 35 deletions(-)

diff --git a/_docs/configure-drill/121-configuring-cgroups-to-control-cpu-usage.md b/_docs/configure-drill/121-configuring-cgroups-to-control-cpu-usage.md
index 7b3e9c5..b5914ed 100644
--- a/_docs/configure-drill/121-configuring-cgroups-to-control-cpu-usage.md
+++ b/_docs/configure-drill/121-configuring-cgroups-to-control-cpu-usage.md
@@ -1,27 +1,43 @@
 ---
 title: "Configuring cgroups to Control CPU Usage"
-date: 2019-01-25
+date: 2019-02-05
 parent: "Configure Drill"
 ---   
 
-Starting in Drill 1.13, you can configure a Linux cgroup to enforce CPU limits on the Drillbit service running on a node. Linux cgroups (control groups) enable you to limit system resources to defined user groups or processes. You can use the cgconfig service to configure a Drill cgroup to control CPU usage and then set the CPU limits for the Drill cgroup on each Drill node in the `/etc/cgconfig.conf` file.  
-
-In Drill 1.13, you had to update the `cgroup.procs` file with the Drill process ID (PID) each time a Drillbit restarted in order to enforce the CPU limit for the Drillbit service.  As of Drill 1.14, Drill can directly manage the CPU resources through the Drill start-up script, `drill-env.sh`. You no longer have to manually add the PID to the `cgroup.procs` file each time a Drillbit restarts. This step occurs automatically upon restart. The start-up script checks for the specified cgroup, [...]
+Starting in Drill 1.13, you can configure a Linux cgroup (control group) to enforce CPU limits on the Drillbit service running on a node. Linux cgroups enable you to limit system resources to defined user groups or processes. You can use the cgconfig service to configure a Drill cgroup to control CPU usage and then set the CPU limits for the Drill cgroup on each Drill node in the `/etc/cgconfig.conf` file.  
 
 **Note:** cgroups V2 is recommended.  
 
-The `drill-env.sh` script contains variables that you must enable for Drill to directly manage the CPU resources. Uncomment the following variables in drill-env.sh to enable the feature:  
+##Before You Begin  
+
+Each Drill node must have the `libcgroup` package installed to configure CPU limits for a Drill cgroup. The `libcgroup` package installs the cgconfig service required to configure and manage the Drill cgroup.
+
+Install the `libcgroup` package using the `yum install` command, as shown:  
+
+       yum install libcgroup  
+
+##Enable Drill to Directly Manage CPU Resources   
+
+Starting in Drill 1.14, Drill can directly manage CPU resources through the start-up script, `drill-env.sh`, which means that you no longer have to manually add the PID (Drill process ID) to the `cgroup.procs` file each time a Drillbit restarts. This step occurs automatically upon restart. The start-up script checks for the specified cgroup, such as drillcpu, and then applies the cgroup to the launched Drillbit JVM. The Drillbit CPU resource usage is then managed under the cgroup, drillcpu.  
+
+For Drill to directly manage CPU resources, you must enable (uncomment) the following variables in the `drill-env.sh` script:  
 
-| Variable                                                  | Description                                                                                                                                                                                                                       |   |
-|-----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
-| export DRILLBIT_CGROUP=${DRILLBIT_CGROUP:-"drillcpu"}     | Sets the cgroup to which the Drillbit belongs when running as a daemon using drillbit.sh start. Drill uses the cgroup for CPU enforcement only.                                                                                   |   |
-| export SYS_CGROUP_DIR=${SYS_CGROUP_DIR:-"/sys/fs/cgroup"} | Drill assumes the default cgroup mount location set by systemd (the system and service manager for Linux operating systems). If your cgroup mount location is in a different location, change the setting to match your location. |   |
-| export DRILL_PID_DIR=${DRILL_PID_DIR:-$DRILL_HOME}        | The location of the Drillbit PID file when Drill is running as a daemon using drillbit.sh start. By default, this location is set to $DRILL_HOME.                                                                                 |   |  
+| Variable                                                    | Description                                                                                                                                                                                                                             |
+|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| export   DRILLBIT_CGROUP=${DRILLBIT_CGROUP:-"drillcpu"}     | Sets   the cgroup to which the Drillbit belongs when running as a daemon using   drillbit.sh start. Drill uses the cgroup for CPU enforcement only.                                                                                     |
+| export   SYS_CGROUP_DIR=${SYS_CGROUP_DIR:-"/sys/fs/cgroup"} | Drill   assumes the default cgroup mount location set by systemd (the system and   service manager for Linux operating systems). If your cgroup mount location   is in a different location, change the setting to match your location. |
+| export   DRILL_PID_DIR=${DRILL_PID_DIR:-$DRILL_HOME}        | The   location of the Drillbit PID file when Drill is running as a daemon using   drillbit.sh start. By default, this location is set to $DRILL_HOME.                                                                                   |  
 
+**********  
+**NOTE**  
+If you have Drill 1.13 running on the node, or you have Drill 1.14 running on the node and you do not want to enable Drill to directly manage the CPU resources through `drill-env.sh`, you must manually update the `/cgroup/cpu/drillcpu/cgroup.procs` file with the PID (Drill process ID), as shown, each time a Drillbit restarts to enforce the CPU limit for the Drillbit service:  
 
-##CPU Limits  
+	echo 25809 > /cgroup/cpu/drillcpu/cgroup.procs      
+********  
 
-You can set the CPU limit as a soft or hard limit, or both. You set the limits with parameters in the `/etc/cgconfig.conf` file. The hard limit takes precedence over the soft limit. When Drill hits the hard limit, in-progress queries may not complete. The following sections describe the parameters for soft and hard limits.  
+##Set the CPU Limit for the Drillbit Service 
+
+You can set the CPU limit as a soft or hard limit, or both. You set the limits with parameters in the `/etc/cgconfig.conf` file. The hard limit takes precedence over the soft limit. When Drill hits the hard limit, in-progress queries may not complete. Review the following sections that describe the soft and hard limit parameters and then configure CPU limits.  
 
 **Soft Limit Parameter**  
 You set the soft limit with the `cpu.shares` parameter. When you set a soft limit, Drill can exceed the CPU allocated if extra CPU is available for use on the system. Drill can continue to use CPU until there is contention with other processes over the CPU or Drill hits the hard limit.  
@@ -34,24 +50,17 @@ The `cpu.cfs_quota_us` parameter specifies a segment of time (in microseconds re
 
 
 - **`cpu.cfs_quota_us`**  
-The `cpu.cfs_quota_us` parameter specifies the total amount of runtime (in microseconds represented by `us` for µs) for which all tasks in the Drill cgroup can run during one period (as defined by cpu.cfs_period_us). As soon as tasks in the Drill cgroup use the time specified by the quota, they are throttled for the remainder of the time specified by the period and not allowed to run until the next period. For example, if tasks in the Drill cgroup can access a single CPU for 0.2 seconds  [...]
-
-##Before You Begin
-Each Drill node must have the libcgroup package installed to configure CPU limits for a Drill cgroup. The libcgroup package installs the cgconfig service required to configure and manage the Drill cgroup.
-
-You can install the libcgroup package using the `yum install` command, as shown:  
-
-       yum install libcgroup  
+The `cpu.cfs_quota_us` parameter specifies the total amount of runtime (in microseconds represented by `us` for µs) for which all tasks in the Drill cgroup can run during one period (as defined by cpu.cfs_period_us). As soon as tasks in the Drill cgroup use the time specified by the quota, they are throttled for the remainder of the time specified by the period and not allowed to run until the next period. For example, if tasks in the Drill cgroup can access a single CPU for 0.2 seconds  [...]
 
 
-##Configuring CPU Limits
-Complete the following steps to set a hard and/or soft limit on Drill CPU usage for the Drill process running on the node:  
+###Configuring CPU Limits  
+Complete the following steps to set a hard and/or soft CPU limit for the Drill process running on the node:  
 
 1-Start the cgconfig service:  
 
         service cgconfig start
 
-2-Add a cgroup for Drill in the /etc/cgconfig.conf file:    
+2-Add a cgroup for Drill in the `/etc/cgconfig.conf` file:    
 
               group drillcpu {
                      cpu {
@@ -60,20 +69,19 @@ Complete the following steps to set a hard and/or soft limit on Drill CPU usage
                             cpu.cfs_period_us = 100000;
                             }
                      }  
-**Note:** The cgroup name is specific to the Drill cgroup and does not correlate with any other configuration.   
   
-In the configuration example, the `cpu.shares` parameter sets the soft limit. The other two parameters, `cpu.cfs_quota_us` and `cpu.cfs_period_us`, set the hard limit. If you prefer to set only one type of limit, remove the parameters that do not apply.  
+In the configuration example above, the `cpu.shares` parameter sets the soft limit. The other two parameters, `cpu.cfs_quota_us` and `cpu.cfs_period_us`, set the hard limit. If you prefer to set only one type of limit, remove the parameters that do not apply.  
 
-To set a soft limit, allocate a specific number of CPU shares to the Drill cgroup in the configuration. Calculate the CPU shares as:  
+When setting a soft limit, allocate a specific number of CPU shares to the Drill cgroup in the configuration. Calculate the CPU shares as:  
 
        1024 (CPU allocated to Drill/Total available CPU)
 
-In the example, CPU shares was calculated as:  
+In the example, CPU shares is calculated as:  
 
        1024 (10/32) = 320
 
 
-To set a hard limit, add limits to the `cpu.cfs_quota_us` and `cpu.cfs_period_us` parameters. In the configuration example, the Drill process can fully utilize 4 CPU.  
+When setting a hard limit, add limits to the `cpu.cfs_quota_us` and `cpu.cfs_period_us` parameters. In the example, the Drill process can fully utilize 4 CPU.  
 
 **Note:** The hard limit parameter settings persist after each cgroup service restart. Alternatively, you can set the parameters at the session level using the following commands:  
 
@@ -84,13 +92,7 @@ To set a hard limit, add limits to the `cpu.cfs_quota_us` and `cpu.cfs_period_us
 
        chkconfig cgconfig on  
 
-**Note:** Only complete step 4 if you have Drill 1.13 running on the node, or you have Drill 1.14 running on the node and you have not enabled Drill to directly manage the CPU resources through the start-up script, `drill-env.sh`.   
-  
-4-Run the following command to add the Drill process ID (PID) to the /cgroup/cpu/drillcpu/cgroup.procs file, as shown:  
-
-       echo 25809 > /cgroup/cpu/drillcpu/cgroup.procs
-
-**Note:** You must perform this step each time a Drillbit restarts.  
+******************************************    
 
 For additional information, refer to the following documentation:  
 - [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html)