lot of process (du, xargs, sed) running on the server
search cancel

lot of process (du, xargs, sed) running on the server

book

Article ID: 372954

calendar_today

Updated On:

Products

CA Client Automation - IT Client Manager CA Client Automation

Issue/Introduction

A lot of process (du, xargs, sed) taking lot of cpu are seen on the server affecting a lot the performance for other installed applications.
These process are executed by amhwinvux process (AM Hardware Inventory)

Example :

             ├─ 109586 /opt/CA/DSM/Agent/AM/plugin/amhwinvux -o /opt/CA/DSM/Agent/AM/data/transfer/12amhwinvux
             ├─ 109634 xargs du
             ├─ 109635 sed /^0/d
             ├─ 109636 sed "s/\t/ / ; s/  */ /"
             ├─ 109637 cut "-d " -f2
             ├─ 109638 du
             ├─ 109675 xargs du
             ├─ 109676 sed /^0/d
             ├─ 109677 sed "s/\t/ / ; s/  */ /"
             ├─ 109678 cut "-d " -f2
             ├─ 109679 du
             ├─ 109720 xargs du
             ├─ 109721 sed /^0/d
             ├─ 109722 sed "s/\t/ / ; s/  */ /"
             ├─ 109723 cut "-d " -f2
             ├─ 109724 du

Environment

Client Automation 14.5
Agents 14.5.0.550 on Linux
This version if from patch 99111801 : Linux certifications-R14.5-x64

Cause

In TRC_UAM_AMHWINVUX_0.log we could see this :

140222-14:30:23.5003950L|079411|316e5720|HWInv     |HWInv           |Pr_NetworkBindingsTC|000939|INFO   | ENTER method PrintDHCPInfo
140222-14:30:23.5050690L|079411|316e5720|HWInv     |HWInv           |Pr_NetworkBindingsTC|000959|INFO   | command: <ps aux | grep -- '-lf .*\.lease' | grep -v grep | grep -v sed | sed 's/\.lease/@/ ; s/^.*-lf \([^@]*@s*\) .*/\1/ ; s/@/\.lease/' | xargs du | sed '/^0/d' | sed 's/ / / ; s/  */ /' | cut -d' ' -f2>

 
Following command line is executed
ps aux | grep -- '-lf .*\.lease' | grep -v grep | grep -v sed | sed 's/\.lease/@/ ; s/^.*-lf \([^@]*@s*\) .*/\1/ ; s/@/\.lease/' | xargs du | sed '/^0/d' | sed 's/ / / ; s/  */ /' | cut -d' ' -f2
 
Generally this command returns the dhclient*.lease file found for dhclient process
  
But if there is no dhclient process running, xargs du is executed with empty string and "du" without parameter is executed.
"du" without parameter, returns the size of all directories recursively (from directory where command is executed).
If file system in huge, the command could take very long time.

Resolution

Open a case at Broadcom Technical Support and ask for the fix T533389
This fix delivers the file amhwinvux :
Size = 331 672 bytes
Modified Date = 27 June 2024

Additional Information

This fix replaces the command line 
ps aux | grep -- '-lf .*\.lease' | grep -v grep | grep -v sed | sed 's/\.lease/@/ ; s/^.*-lf \([^@]*@s*\) .*/\1/ ; s/@/\.lease/' | xargs du | sed '/^0/d' | sed 's/ / / ; s/  */ /' | cut -d' ' -f2
by
ps aux | grep -- '-lf .*\.lease' | grep -v grep | grep -v sed | sed 's/\.lease/@/ ; s/^.*-lf \([^@]*@s*\) .*/\1/ ; s/@/\.lease/' | xargs -r du | sed '/^0/d' | sed 's/ / / ; s/  */ /' | cut -d' ' -f2
 
-r parameter has been added in xargs
 
-r, --no-run-if-empty
              If the standard input does not contain any nonblanks, do
              not run the command.  Normally, the command is run once
              even if there is no input.  This option is a GNU
              extension.