Bug 1584127

Summary: allow control-cpu-load.sh(cgroups tunables) to also take process names as input(eg: glusterd or glusterfsd)
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Nag Pavan Chilakam <nchilaka>
Component: coreAssignee: Mohit Agrawal <moagrawa>
Status: CLOSED WONTFIX QA Contact: Rahul Hinduja <rhinduja>
Severity: medium Docs Contact:
Priority: low    
Version: rhgs-3.4CC: nchilaka, rhs-bugs, storage-qa-internal
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-19 03:53:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nag Pavan Chilakam 2018-05-30 10:55:30 UTC
Description of problem:
--------------
to control cpu load by gluster resources we can now cap the consumption by running control-cpu-load.sh script.

However I have to mention the PID as the input.
While that is ok, I would also want the input parameter to be process name.

eg:
I want to curtail cpu consumption of glusterd process.
I now will have to grep for the pid and then feed it to the script.
Also If I want to do it on all gluster nodes, then the PID can differ
Instead also give me an option to enter PID name

eg: I would enter "glusterd" as the input param and that should take care of applying the resource caps

[root@dhcp35-97 scripts]# ./control-cpu-load.sh 
Enter gluster daemon pid for which you want to control CPU.
glusterd
Entered daemon_pid is not numeric so Rerun the script.
[root@dhcp35-97 scripts]# ./control-cpu-load.sh 

gluster:
3.12.2-11

Comment 4 Mohit Agrawal 2018-11-19 09:35:49 UTC
Hi,

The main purpose to use cgroup for client process is because we don't want to fix the issue for the client (glustershd,quota etc).
The cgroup is just a workaround to mitigate the issue but we would not suggest using the script for all gluster process.
The other thing I am not able to understand what we will achieve if we do change the script to accept process name instead of pid.
As I mentioned script is useful only for a client so we don't provide process name as an argument because all client process use same binary name glusterfsd.

Thanks,
Mohit Agrawal

Comment 5 Nag Pavan Chilakam 2018-12-03 08:45:06 UTC
(In reply to Mohit Agrawal from comment #4)
> Hi,
> 
> The main purpose to use cgroup for client process is because we don't want
> to fix the issue for the client (glustershd,quota etc).
> The cgroup is just a workaround to mitigate the issue but we would not
> suggest using the script for all gluster process.
> The other thing I am not able to understand what we will achieve if we do
> change the script to accept process name instead of pid.
> As I mentioned script is useful only for a client so we don't provide
> process name as an argument because all client process use same binary name
> glusterfsd.
> 
> Thanks,
> Mohit Agrawal

We can use cgroup script for glusterd and glusterfsd and not just client processes like shd/quotas
Also, providing name is easier from a admin perspective.
if the scope of the feature is limited, then if you feel it is not worth the time and effort implementing this, kindly go ahead and close this as won't fix