From: Kruti Date: Fri, 3 May 2024 16:05:45 +0000 (-0700) Subject: Service Discovery data collection duration takes > 70 minutes when X-Git-Tag: stable-12.5.0~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9aaf02fd8c3e928bc1706fc9c692a6190a03a23;p=thirdparty%2Fopen-vm-tools.git Service Discovery data collection duration takes > 70 minutes when monitoring large setups. The issue happens on vrops node VMs that are part of large clusters because these kind of nodes typically have a large amount of tcp/udp connections. The root cause of the issue is an enormous number of spaces generated by "ss -antup | grep -E $pattern" command in get-connection-info.sh. The SDMP plugin considers these spaces while calculating the chunk size for writing into NDB and writing about 200-400 chunks for the get-connection-info key. Processing of this amount of data slows down the discovery process on both the adapter and plugin sides and, as a result, the discovery exceeds the timing limit and fails. The solution is to remove unnecessary spaces from the end of the get-connection-info output lines. --- diff --git a/open-vm-tools/services/plugins/serviceDiscovery/get-connection-info.sh b/open-vm-tools/services/plugins/serviceDiscovery/get-connection-info.sh index 5b49442e6..804f651ee 100644 --- a/open-vm-tools/services/plugins/serviceDiscovery/get-connection-info.sh +++ b/open-vm-tools/services/plugins/serviceDiscovery/get-connection-info.sh @@ -15,4 +15,4 @@ space_separated_pids=$(ss -lntup | grep -Eo "pid=[0-9]+" | sort -u) pattern=$(echo $space_separated_pids | tr ' ' '|') # get matching lines -ss -antup | grep -E $pattern +ss -antup | grep -E $pattern | sed 's/[ \t]*$//'