VMware Cloud Community
bpoultier
Contributor
Contributor

update CPU affinity mask

Hi all,

I've some servers with 2 hardware CPU and 8 cores per one.
I would like to known wich startup file where I can set a taskset command to move hq-agent to affinity.
Do I nedd to touch the wrapper configuration ?
I've located hq-agent.sh and I imagine that the pid location can help me to set the affinity.

Thank you.

Message was edited by: bpoultier

Message was edited by: bpoultier

Message was edited by: bpoultier
Reply
0 Kudos
2 Replies
rwmastel
Contributor
Contributor

I too would like to know how to set the agent to run on a specified processor.  I have some VMs with 4 vCPU and the applications seems to spike CPU 1, but not 2, 3, or 4.  The agent can't collect metrics or communicate to the HQ server, so we get a false alert that the platform is down.  If the agent could run on a different CPU, then this would not be a problem.


Thanks!

Rodd

Reply
0 Kudos
bpoultier
Contributor
Contributor

Rodd,

I pass throw a script to locate the pid and set the cpu affiny.

When the agent start, it create a pid file under AGENT_HOME/wrapper/hq-agent.pid:


#locate wrapper pid

WRAPPERPID=`cat ~/agent.x.x/wrapper/hq-agent.pid`

#locate agent pid under parent pid control.

AGPID=`grep ps -eaf | grep $WRAPPERPID | grep "/bin/java" | awk '{print $2}' `

#set CPU affinity

taskset -c -p 0x1 $AGPID.



Second solution is possible. To avoid orphanated alert(s), I've change the alert definition like this:

"Analyze" tab -> "Definition" tab -> Select the alert -> Change condition

Alert Condition Set: Once every  3  times conditions are met within a time period of 5 min.


I hope is helpfull.

Bruno.


Reply
0 Kudos