Bug 1766425 - cgroup control-cpu-load.sh script not working
Summary: cgroup control-cpu-load.sh script not working
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: core
Version: 6
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
Assignee: Mohit Agrawal
QA Contact:
URL:
Whiteboard:
Depends On: 1764202 1764208
Blocks: 1766424
TreeView+ depends on / blocked
 
Reported: 2019-10-29 02:52 UTC by Mohit Agrawal
Modified: 2019-12-27 09:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1764208
Environment:
Last Closed: 2019-11-19 13:32:37 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Gluster.org Gerrit 23635 None Merged extras: Cgroup(CPU/Mem) restriction are not working on gluster process 2019-11-19 13:32:36 UTC

Comment 1 Mohit Agrawal 2019-10-29 02:53:13 UTC
RCA:
  As per current code in script it moves the thread of any gluster process those have gluster keyword 
  as a substring and as of now all gluster threads has glfs prefix so script is not able to move all
  gluster threads to new created cgroup and cgroup restriction are not working

  if ps -T -p ${daemon_pid} | grep gluster > /dev/null; then
  for thid in `ps -T -p ${daemon_pid} | grep gluster | awk -F " " '{print $2}'`;
    do
      echo ${thid} > ${LOC}/${cgroup_name}/tasks ;
    done
  if cat /proc/${daemon_pid}/cgroup | grep -w ${cgroup_name} > /dev/null; then
    echo "Tasks are attached successfully specific to ${daemon_pid} to ${cgroup_name}."
  else
    echo "Tasks are not attached successfully."
  fi
fi
 
To avoid the same need to change the script for loop condition like below

if ps -T -p ${daemon_pid} | grep gluster > /dev/null; then
  for thid in `ps -T -p ${daemon_pid} | grep -v SPID | awk -F " " '{print $2}'`;
    do
      echo ${thid} > ${LOC}/${cgroup_name}/tasks ;
    done
  if cat /proc/${daemon_pid}/cgroup | grep -w ${cgroup_name} > /dev/null; then
    echo "Tasks are attached successfully specific to ${daemon_pid} to ${cgroup_name}."
  else
    echo "Tasks are not attached successfully."
  fi
fi

Comment 2 Worker Ant 2019-10-29 02:56:33 UTC
REVIEW: https://review.gluster.org/23635 (extras: Cgroup(CPU/Mem) restriction are not working on gluster process) posted (#1) for review on release-6 by MOHIT AGRAWAL

Comment 3 Worker Ant 2019-11-19 13:32:37 UTC
REVIEW: https://review.gluster.org/23635 (extras: Cgroup(CPU/Mem) restriction are not working on gluster process) merged (#2) on release-6 by hari gowtham


Note You need to log in before you can comment on or make changes to this bug.