[ https://issues.apache.org/jira/browse/DRILL-143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16449301#comment-16449301 ]
ASF GitHub Bot commented on DRILL-143: -------------------------------------- Github user Ben-Zvi commented on a diff in the pull request: https://github.com/apache/drill/pull/1239#discussion_r183607110 --- Diff: distribution/src/resources/yarn-drillbit.sh --- @@ -110,6 +114,36 @@ # Enables Java GC logging. Passed from the drill.yarn.drillbit.log-gc # garbage collection option. +### Function to enforce CGroup (Refer local drillbit.sh) +check_and_enforce_cgroup(){ + dbitPid=$1; + kill -0 $dbitPid + if [ $? -gt 0 ]; then + echo "ERROR: Failed to add Drillbit to CGroup ( $DRILLBIT_CGROUP ) for 'cpu'. Ensure that the Drillbit ( pid=$dbitPid ) started up." >&2 + exit 1 + fi + SYS_CGROUP_DIR=${SYS_CGROUP_DIR:-"/sys/fs/cgroup"} + if [ -f $SYS_CGROUP_DIR/cpu/$DRILLBIT_CGROUP/cgroup.procs ]; then + echo $dbitPid > $SYS_CGROUP_DIR/cpu/$DRILLBIT_CGROUP/cgroup.procs + # Verify Enforcement + cgroupStatus=`grep -w $pid $SYS_CGROUP_DIR/cpu/${DRILLBIT_CGROUP}/cgroup.procs` + if [ -z "$cgroupStatus" ]; then --- End diff -- I'm confused: Is this checking for $dbitPid (in cgroup.procs) or for $pid ? In case the former, then need to negate the following "-z" condition. > Support CGROUPs resource management > ----------------------------------- > > Key: DRILL-143 > URL: https://issues.apache.org/jira/browse/DRILL-143 > Project: Apache Drill > Issue Type: New Feature > Reporter: Jacques Nadeau > Assignee: Kunal Khatua > Priority: Major > Labels: doc-impacting, ready-to-commit > Fix For: 1.14.0 > > Attachments: 253ce178-ddeb-e482-cd64-44ab7284ad1c.sys.drill > > > For the purpose of playing nice on clusters that don't have YARN, we should > write up configuration and scripts to allows users to run Drill next to > existing workloads without sharing resources. -- This message was sent by Atlassian JIRA (v7.6.3#76005)