Pod JVM method latency
Pod JVM method latency slows down the Java application executing on Kubernetes pod by introducing delays in executing the method calls.
tip
JVM chaos faults use the Byteman utility to inject chaos faults into the JVM.
Use cases
Pod JVM method latency:
- Determines the performance bottlenecks of the application.
- Tests the system's ability to handle heavy payloads.
- Evaluates the application's behavior in high-stress cases.
- Determines how quickly an application returns to normalcy after the delay.
- Determines the performance and resilience of the dependant application (or services) running on Kubernetes.
Mandatory tunables
Tunable | Description | Notes |
---|---|---|
CLASS | Specify as packageName.className that specifies the class in which you define the target method. | Specify it in the format packageName.className . For example, org.framework.appName.system.WelcomeController . |
LATENCY | The delay you want to introduce in the application (in ms). | Default: 2000 ms. |
METHOD | The method in which latency is injected. | For example, Welcome . For more information, go to method name. |
Optional tunables
Tunable | Description | Notes |
---|---|---|
TOTAL_CHAOS_DURATION | Duration through which chaos is injected into the target resource. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. | Default: 30s . Examples: 1m25s , 1h3m2s , 1h3s . For more information, go to duration of the chaos. |
POD_AFFECTED_PERC | Percentage of total pods to target. Provide numeric values. | Default: 0 (corresponds to 1 replica). For more information, go to pods affected percentage |
JAVA_HOME | Path to the Java installation directory. | For example, /tmp/dir/jdk. |
BYTEMAN_PORT | Port used by the Byteman agent. | Default: 9091 . |
CONTAINER_RUNTIME | Container runtime interface for the cluster | Default: containerd. Support values: docker, containerd and crio. For more information, go to container runtime. |
SOCKET_PATH | Path of the containerd or crio or docker socket file. | Default: /run/containerd/containerd.sock . For more information, go to socket path. |
RAMP_TIME | Period to wait before and after injecting chaos. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. | Default: 0s . Examples: 1m25s , 1h3m2s , 1h3s . For more information, go to ramp time. |
SEQUENCE | Sequence of chaos execution for multiple target pods. | Default: parallel. Supports serial and parallel. For more information, go to sequence of chaos execution. |
TARGET_CONTAINER | Name of the container subject to API header modification. | None. For more information, go to target specific container |
TARGET_PODS | Comma-separated list of application pod names subject to pod HTTP modify body. | If not provided, the fault selects target pods randomly based on provided appLabels. For more information, go to target specific pods. |
NODE_LABEL | Node label used to filter the target node if TARGET_NODE environment variable is not set. | It is mutually exclusive with the TARGET_NODE environment variable. If both are provided, the fault uses TARGET_NODE . For more information, go to node label. |
LIB_IMAGE | Image used to inject chaos. | Default: harness/chaos-go-runner:main-latest . For more information, go to image used by the helper pod. |
Parameters
The following YAML snippet illustrates the use of these tunables:
apiVersion: litmuschaos.io/v1alpha1
kind: KubernetesChaosExperiment
metadata:
name: pod-jvm-method-latency
namespace: hce
env:
- name: TOTAL_CHAOS_DURATION
value: "60"
- name: POD_AFFECTED_PERCENTAGE
value: ""
- name: BYTEMAN_PORT
value: "9091"
- name: JAVA_HOME
value: ""
- name: METHOD #mandatory
value: Welcome
- name: CLASS #mandatory
value: org.framework.appName.system.WelcomeController
- name: LATENCY #mandatory
value: "2000"
- name: CONTAINER_RUNTIME
value: containerd
- name: SOCKET_PATH
value: /run/containerd/containerd.sock
- name: LIB_IMAGE
value: docker.io/harness/chaos-ddcr-faults:1.49.2
- name: RAMP_TIME
value: ""
- name: SEQUENCE
value: parallel
- name: TARGET_CONTAINER
value: ""
- name: TARGET_PODS
value: ""
- name: NODE_LABEL
value: ""