Introduction
This document describes persistent changes required to set desired system load average threshold values of VMs in Cisco Policy Suite (CPS) cluster.
Prerequisites
Requirements
There are no specific requirements for this document.
Cisco recommends that you have knowledge of these topics:
- Linux
- CPS Platform and CPS Cluster architecture
- Policy and Charging Rules Function (PCRF)
- Vi editor commands
Components Used
The information in this document is based on CPS 24.1 version and AlmaLinux release 8.8.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Background Information
System load values (Load-1, Load-5, Load-15) from the Linux command top indicates load average values in VM sampled every 1 min, 5 min and 15 min:
[root@HOSTNAME-VM01 ~]# top
top - 20:23:21 up 10 days, 2:11, 1 user, load average: 5.12, 8.67, 8.56
Tasks: 432 total, 2 running, 425 sleeping, 0 stopped, 5 zombie
%Cpu(s): 8.2 us, 3.3 sy, 0.0 ni, 87.2 id, 0.2 wa, 0.9 hi, 0.2 si, 0.0 st
MiB Mem : 63884.1 total, 23587.4 free, 11090.1 used, 29206.5 buff/cache
MiB Swap: 4096.0 total, 4096.0 free, 0.0 used. 48924.5 avail Mem
The threshold values for these three sampling intervals can be modified to desired values in the CPS cluster VMs by editing /etc/snmp/snmpd.conf in those respective VMs, so that HighLoad threshold-crossed alarms can be generated for the configured threshold. However, these VM-level changes are not persistent and are reverted to default values once VMs are rebooted.
As the standard procedure, to make these changes persistent, modify the CPS cluster VMs puppet files from Cluster Manager VM using procedure defined in CPS installation guide under the section Enable Custom Puppet to Configure Deployment. As per current configuration in the VM puppet file, these values can not be changed and is fixed to the value: 1.5 * Number of vCPUs (allocated to VM).
A configuration change is mentioned in this document to persistently modify this default logic to the desirable HighLoad threshold values.
Problem
The CPS cluster VM (LB VM, Sessionmgr VM, Pcrfclient VM and QNS VM) puppet files from Cluster Manager VM are located at path: /etc/puppet/modules/qps/templates/etc/snmp:
pcrfclient.snmpd.conf
lb.snmpd.conf
sessionmgr.snmpd.conf
qns.snmpd.conf
By default, it has static configurations to determine the HighLoad threshold values:
<% @load_val=`nproc | awk '{res = $1 * 1.5; printf "%d", res}'` %>
load <%= @load_val %> <%= @load_val %> <%= @load_val %>
This indicates that the default threshold value is 1.5 * Number of vCPUs (allocated to VM) for each time period. Hence, due to this static configuration, the desired average threshold value can not be set for all three time periods.
Solution
Modify the default static configuration given in the respective VMs snmpd.conf puppet files as shown:
<% @load_val=`nproc | awk '{res = $1 * 1.5; printf "%d", res}'` %>
load <%= @load_val %> <%= @load_val %> <%= @load_val %>
<% @load_val_1 = 55 %>
<% @load_val_2 = 55 %>
<% @load_val_3 = 36 %>
load <%= @load_val_1 %> <%= @load_val_2 %> <%= @load_val_3 %>
Note: Here, values 55, 55, and 36 are indicative only. Assign the actual values according to the requirements.
Procedure to Persist These Changes
To make these configuration changes in puppet files, it is recommended to use the procedure mentioned in the CPS installation guide under the section Enable Custom Puppet to Configure Deployment.
Reference link :
Verification
To verify the changes with new values, run the for loop command from the Cluster Manager VM:
for host in $(hosts-all.sh); do echo $host; ssh $host "cat /etc/snmp/snmpd.conf | grep load"; done