The MSE Microservices Governance Java agent instruments bytecode at runtime to enable governance capabilities such as canary releases and throttling. The following benchmark results measure the agent's impact on CPU, memory, and response time under realistic traffic loads.
Key findings
Under controlled stress testing, the MSE Java agent adds minimal overhead:
| Load | CPU overhead | Memory overhead | Response time (RT) increase per hop |
|---|---|---|---|
| 250 queries per second (QPS) per instance | +2.96% avg | +0.19 GiB avg | +0.2 ms |
| 500 QPS per instance | +6.37% avg | +0.16 GiB avg | +0.2 ms |
At 250 QPS, average CPU usage rises from 6.30% to 9.25%. At 500 QPS, it rises from 12.24% to 18.60%. Memory consumption increases by roughly 160--190 MiB per service on average. End-to-end RT increases by less than 1 ms across the full call chain (four hops).
Agent overhead scales with QPS. The percentages above are absolute increases, not multipliers. Actual overhead in your environment depends on hardware, JVM version, application architecture, and traffic patterns.
Test environment
| Component | Configuration |
|---|---|
| Stress test tool | Performance Testing Service (PTS) |
| Cluster | Container Service for Kubernetes (ACK), single cluster |
| Node instance type | ecs.g6.2xlarge |
| Operating system | Alibaba Cloud Linux 3.2104 LTS 64-bit (container-optimized) |
| Pod resources | 2 cores, 4 GB memory, 2 replicas per application |
| Agent version | Aliyun JavaAgent 4.4.0 |
| JVM parameters | -Xms3500m -Xmx3500m -XX:MetaspaceSize=500m |
All services (the Java application, MySQL, and Redis) run in the same ACK cluster.
Test architecture
The application uses Spring MVC with a four-service call chain:
Requests target ${gateway}/A/httpTest and ${gateway}/A/dubboTest. To isolate network effects, Redis and MySQL calls are simulated on the client side, though the agent instrumentation logic still runs.
Test procedure
Baseline measurement (no agent)
Run three stress tests at 500 QPS and three at 1,000 QPS without the MSE Java agent installed.
Before each test, warm up the application for 3 minutes at 100 QPS.
Run each test for 20 minutes.
Record CPU usage, memory usage, and RT as baseline metrics.
Agent measurement
Install the MSE Java agent.
Configure governance rules:
An end-to-end canary release traffic lane with a 50% traffic ratio.
A throttling rule with a 10,000 QPS threshold per interface.
Repeat the same stress tests and warm-up procedure.
Compare CPU, memory, and RT against the baseline.
Detailed results
Agent overhead by service
At 250 QPS per instance:
| Service | CPU overhead | Memory overhead |
|---|---|---|
| Gateway | +3.085% | +0.167 GiB |
| A | +4.055% | +0.215 GiB |
| B | +3.435% | +0.193 GiB |
| C | +1.255% | +0.1935 GiB |
| Average | +2.96% | +0.192 GiB |
At 500 QPS per instance:
| Service | CPU overhead | Memory overhead |
|---|---|---|
| Gateway | +7.11% | +0.1655 GiB |
| A | +6.40% | +0.202 GiB |
| B | +7.15% | +0.1495 GiB |
| C | +4.80% | +0.1275 GiB |
| Average | +6.37% | +0.161 GiB |
RT increase per hop: +0.2 ms at both 250 and 500 QPS.
Baseline metrics (no agent)
At 250 QPS per instance:
| Service | CPU | Memory | RT (end-to-end) |
|---|---|---|---|
| Gateway | 4.25% | 1.323 GiB | 109 ms |
| A | 8.445% | 1.383 GiB | |
| B | 6.15% | 1.424 GiB | |
| C | 6.34% | 1.477 GiB |
At 500 QPS per instance:
| Service | CPU | Memory | RT (end-to-end) |
|---|---|---|---|
| Gateway | 7.74% | 1.354 GiB | 112 ms |
| A | 17.15% | 1.424 GiB | |
| B | 12.65% | 1.4725 GiB | |
| C | 11.40% | 1.509 GiB |
Metrics with agent enabled
At 250 QPS per instance:
| Service | CPU | Memory | RT (end-to-end) |
|---|---|---|---|
| Gateway | 7.335% | 1.490 GiB | 110 ms |
| A | 12.50% | 1.598 GiB | |
| B | 9.585% | 1.617 GiB | |
| C | 7.595% | 1.6705 GiB |
At 500 QPS per instance:
| Service | CPU | Memory | RT (end-to-end) |
|---|---|---|---|
| Gateway | 14.85% | 1.5195 GiB | 113 ms |
| A | 23.55% | 1.626 GiB | |
| B | 19.80% | 1.622 GiB | |
| C | 16.20% | 1.6365 GiB |
Factors that affect overhead
Agent overhead varies by environment. The benchmark results above reflect a specific test setup and serve as reference data, not guarantees. Factors that may change your results include:
Hardware: CPU architecture, clock speed, available memory
Containerization: Resource limits, co-located workloads, node density
JVM configuration: JVM vendor and version, garbage collection settings, heap size
Application design: Call chain depth, number of instrumented frameworks, span volume
Traffic patterns: Request concurrency, payload size, error rate
Measure overhead in your environment
To obtain representative measurements for your own workload:
Prepare the test environment. Use a configuration that resembles production. Isolate the application under test from other services and remove unnecessary system processes on the host.
Warm up the JVM. Run a warm-up phase (for example, 3 minutes at moderate load) before collecting measurements. The JVM performs just-in-time (JIT) compilation and class loading optimizations during startup that can skew early results.
Run multiple iterations. Repeat each test at least three times to account for variance.
Change one variable at a time. Toggle the agent on or off, then compare. Avoid changing multiple factors between test runs.
Capacity planning
When deploying the MSE Java agent, account for the following resource increases per pod:
| Resource | Additional allocation |
|---|---|
| Memory | +200 MiB |
| CPU | Approximately +3% at 250 QPS, +6.4% at 500 QPS (scales with load) |
These values are based on the test configuration described above (2-core, 4 GB pods running Aliyun JavaAgent 4.4.0). Adjust for your specific workload and instance size.
Usage notes
When a single instance exceeds 10,000 QPS, the agent automatically degrades certain capabilities to maintain stability. This may affect end-to-end canary release functionality. If your production workload reaches this threshold, submit a ticket for guidance.
The RT overhead (+0.2 ms per hop) is consistent across both tested QPS levels, indicating that latency impact does not scale significantly with load in this range.