Performance test report of the ARMS agent for Java V4.x

Updated at:

The Application Real-Time Monitoring Service (ARMS) agent uses bytecode enhancement at runtime to monitor application performance. Like other bytecode-based monitoring solutions, the ARMS agent for Java introduces some performance overhead. The ARMS team has optimized the agent to keep this overhead minimal while maintaining application stability. This report measures the performance overhead of the ARMS agent for Java V4.x under different traffic loads. Review this report before you connect your application to Application Monitoring.

Test scenarios

Flowchart

image

The Java application is developed in Spring Web MVC and accesses MySQL and Redis through the Druid and Jedis frameworks. Requests are sent from Alibaba Cloud Performance Testing (PTS).

  • When receiving the ${mall-gateway}/case/api/v1/mysql/execute requests, the application accesses MySQL 1 to 4 times per request.

  • When receiving the ${mall-gateway}/case/api/v1/redis/execute requests, the application accesses Redis 1 to 10 times per request.

Test environment

  • The stress testing source is provided by PTS.

  • The Java application, MySQL, and Redis are deployed in the same Alibaba Cloud Container Service for Kubernetes (ACK) cluster. The node instance type is ecs.u1-c1m2.8xlarge, and the node OS is Alibaba Cloud Linux 2.1903 LTS 64-bit.

  • Each pod of the application has 2 cores, 4 GB of memory, and two replicas. The JVM parameters are:

    -Xms3500m -Xmx3500m -XX:MetaspaceSize=500m
  • The version of the ARMS agent for Java is 4.2.1.

  • Sample code

Test procedure

  1. Perform three stress tests at 500, 1,000, and 2,000 QPS. Each stress test lasts 1 hour. Before each stress test, warm up the Java application at 100 QPS for 3 minutes. The test results serve as baseline performance metrics.

  2. Install the ARMS agent for Java. Configure a fixed sampling rate of 10% in the sampling policy, and repeat the stress tests in Step 1 to compare the differences in the CPU overhead, memory overhead, and response time of the Java application.

  3. Install the ARMS agent for Java. Configure a fixed sampling rate of 100% in the sampling policy, and repeat the stress tests in Step 1 to compare the differences in the CPU overhead, memory overhead, and response time of the Java application.

Note
  • For more information about how to configure the sampling policy, see Trace sampling modes (Agent V3.2.8 or later).

  • The basic features of Application Monitoring are enabled, including metrics, traces, and quantiles. All plug-ins are enabled. Some advanced features are temporarily disabled, such as trace compression, URL convergence, data masking, and continuous profiling.

Baseline performance metrics

Item

CPU

Memory

Response time (Unit: milliseconds)

500 QPS

6.737%

11.51%

57.6

1,000 QPS

13.040%

11.81%

63.9

2,000 QPS

26.796%

12.19%

70.5

Note
  • The CPU metric represents the percentage of CPU used by pods relative to the total CPU (2 cores).

  • The memory metric represents the percentage of memory used by pods relative to the total memory. Because pod memory usage grows naturally until it reaches the requests value, this report uses the actual memory usage at the end of the stress tests.

  • The response time metric represents the average response time of requests. Unit: milliseconds.

Performance metrics of the ARMS agent for Java V4.x

Item

10% sampling rate

100% sampling rate

CPU

Memory

Response time (Unit: milliseconds)

CPU

Memory

Response time (Unit: milliseconds)

500 QPS

8.412%

13.72%

58.5

9.316%

13.91%

58.7

1,000 QPS

16.947%

14.14%

64.9

18.114%

14.42%

65.3

2,000 QPS

34.850%

14.64%

74.6

35.945%

14.67%

76.1

Note

The relationship between the sampling rate and both the CPU and QPS is nonlinear. By default, there is an upper limit for trace collection per second.

Performance overhead of the ARMS agent for Java V4.x

Item

10% sampling rate

100% sampling rate

CPU

Memory

Response time (Unit: milliseconds)

CPU

Memory

Response time (Unit: milliseconds)

500 QPS

+1.68%

+2.21%

+0.9

+2.58%

+2.40%

+1.1

1,000 QPS

+3.907%

+2.33%

+1.0

+5.07%

+2.61%

+1.4

2,000 QPS

+8.05%

+2.45%

+4.1

+9.14%

+2.48%

+5.6

Conclusion

  1. The additional CPU and memory overhead caused by the ARMS agent for Java V4.x is within 10%.

  2. The ARMS agent for Java V4.x has minimal impact on response time (within 10%), adding only 1 millisecond at 1,000 QPS.

  3. The performance overhead at a 100% fixed sampling rate is slightly greater than at a 10% fixed sampling rate.