| There are several ways to improve the situations used in ITM environments. Following these five guidelines can drastically reduce CPU usage on the TEMS:
1) Avoid using wildcard characters in situations whenever possible.
2) Use the simplest field possible that will provide the required value. Look at the attributes under consideration in the TEP prior to writing the situation. There may be a field that gives the required value without performing a search operation on that field.
3) If a situation requires searching for a phrase within a field, use 'Scan for string within a string'  4) When performing a 'Count of group members' operation, use a short field for the count. The field selected will not change the result, but will cause less data to be handled to derive it.
5) Avoid using Unicode fields unless they are required. They require more processing then their non-Unicode counterparts.
Below are a few examples of how to rewrite some sample inefficient situations. Scenario 1) Situation ensures syslogd is running.
Original Situation: MISSING(Process Command (Unicode)) == ( '*syslogd*' )
Revised Situation: MISSING(Base Command) == ( 'syslogd' )
Reasoning: The revised situation is better for several reasons. First, it removes the wildcard characters from the situation. Second, it uses a non-Unicode field. Third, it does not require any searching operation as the 'Base Command' field returns exactly the required phrase.
Scenario 2) Situation checks for free space on multiple mount points starting with /opt/IBM
Original Situation: Mount Point == '/opt/IBM*' AND Space Available Percent < 5
Revised Situation: SCAN(Mount Point) == '/opt/IBM' AND Space Available Percent < 5
Reasoning: The revised situation removed the wildcard character and used the more efficient SCAN function.
Scenario 3) Situation checks for more than 3 tecad_logfile processes
Original Situation: Process Command (Unicode) == *tecad_logfile* AND COUNT(Process Command (Unicode)) > '3'
Revised Situation: Base Command == 'tecad_logfile' AND COUNT(Base Command) > '3'
Reasoning: The revised situation uses 'Base Command' instead of a search or wildcard characters to find the required value. It also uses a shorter field to perform the count operation and avoids Unicode fields. |