4.3 KiB
Change-TimeWindow-Interval-via-JMX-or-configmap_686074596
Introduction
With Native SACM enabled, the system collects GraphQL queries from different threads at the TimeWindow interval to generate a batch query for cms-gateway. The default interval of TimeWindow is 100 ms, and you can change it to a larger value via JMX or configmap. A larger interval allows the system to collect more queries in the batch query, but it also causes a side effect that it takes a longer time to finish the processing of a single CI.
Procedure
You can use either JMX or configmap to achieve this.
Using JMX
For versions earlier than 23.4.P2, you can change the TimeWindow interval via JMX. To do this, follow these steps:
- Make sure JDK 8 is installed.
- Download the JMX widget from https://github.com/jiaqi/jmxterm/releases/download/v1.0.2/jmxterm-1.0.2-uber.jar to a directory on the bastion node.
- Copy the changeTWInterval.sh shell script to the same directory that stores jmxterm-1.0.2-uber.jar.
- Run the “sh changeTWInterval.sh” command to set the interval to 500 ms. Or, change the interval to another value (for example, 600) with “sh changeTWInterval.sh 600”.
Note: This method doesn't need a pod restart, however, when a pod restart does take place, the change will be rolled back. The Cloud Ops team needs to take care of this.
Using configmap
For version 24.1 and 24.2, you can change the OOTB value of GraphqlTimeWindow by modifying the configmap and deployment.
For 24.1, follow these steps:
- Run the following command on the control plane node to create a configmap key:
Note: Replace and with the expected time interval (ms) and the suite namespace. The minimum value of CMSX_TIME_WINDOW_TIME_INTERVAL is 100 and the maximum value is 60000000 (1 hour). If you set a value larger than this, 60000000 would be used as this interval. A suitable Interval improves the performance. For example, setting it to 200 increases the number of query batches.
kubectl patch configmap itom-xruntime-infra-config --patch '{"data": {"CMSX_TIME_WINDOW_TIME_INTERVAL": "<Interval>"}}' -n <SuiteNamespace> - Run the following command on the control plane node to add an environment variable in the lookup container for the platform offline deployment:
Note: Replace with the actual suite namespace.
kubectl patch deployment itom-xruntime-platform-offline -n <SuiteNamespace> --patch '{"spec": {"template": {"spec": {"initContainers": [{"name": "lookup-install","env": [{"name":"CMSX_TIME_WINDOW_TIME_INTERVAL", "valueFrom":{"configMapKeyRef":{"name":"itom-xruntime-infra-config", "key": "CMSX_TIME_WINDOW_TIME_INTERVAL", "optional": true}}}]}]}}}}' - If the platform offline pod doesn't restart automatically, manually restart it by running the following command on the control plane node:
Note: Replace with the actual suite namespace.
kubectl rollout restart deployment itom-xruntime-platform-offline -n <SuiteNamespace>
For 24.2, follow these steps:
- Run the following command on the control plane node to change a configmap key:
Note: Replace and with the expected time interval (ms) and the suite namespace. The minimum value of CMSX_TIME_WINDOW_TIME_INTERVAL is 100 and the maximum value is 60000000 (1 hour). If you set a value larger than this, 60000000 would be used as this interval. A suitable Interval improves the performance. For example, setting it to 200 increases the number of query batches.
kubectl patch configmap itom-xruntime-infra-config --patch '{"data": {"CMSX_TIME_WINDOW_TIME_INTERVAL": "<Interval>"}}' -n <SuiteNamespace> - Manually restart the platform offline pod by running the following command on the control plane node:
Note: Replace with the actual suite namespace.
kubectl rollout restart deployment itom-xruntime-platform-offline -n <SuiteNamespace>
Note: This method needs a pod restart and the changes will be saved.