Skip to content

Nacos Stress Test Report

This article aims to evaluate the performance of Nacos registry and configuration center under different resource specifications, using JVM virtual machine testing. It will assist you in determining appropriate resource quotas for Nacos based on your actual business scenarios.

Performance Metrics

TPS: Transactions Per Second, typically refers to the number of transactions processed by a server per second. In the context of this article, it specifically indicates the number of service registration requests that Nacos server can handle per second.

Test Command

java -jar -Xms2g -Xmx2g -Dnacos.server=10.6.222.21:30168 -Dthread.count=100 -Dservice.count=500 nacos-client-1.0-SNAPSHOT-jar-with-dependencies.jar
  • -Xms2g: Initial memory allocation for the JVM.
  • -Xmx2g: Maximum memory allocation for the JVM.
  • -Dnacos.server: Access address of the Nacos registry and configuration center.
  • -Dthread.count: Number of threads, corresponding to concurrency in the test results.
  • -Dservice.count: Number of requests per thread, corresponding to services in the test results.
  • nacos-client-1.0-SNAPSHOT-jar-with-dependencies.jar: Jar package used for stress testing. In actual testing, rename it as nacos-benchmark.jar locally.

Screenshots of the Test Process

process

Test Results

Resource Node Concurrency Services Execution Time (ms) TPS
1 Core 2 GiB 1 30 1000 17086 1755.8
50 1000 23315 2144.5
100 500 26194 1908.4
2 Core 4 GiB 1 30 1000 8794 3409.1
50 1000 15460 3225.8
100 500 15699 3184.7
4 Core 8 GiB 1 50 1000 11843 4221.9
80 1000 14510 5513.4
100 500 9501 5262.6
8 Core 16 GiB 1 50 2000 14391 6948.8
80 2000 18695 8558.4
100 1000 11686 8557.2

Investigating the Impact of JVM Resource Configuration on Nacos Performance

To investigate the impact of JVM resource configuration on the performance of hosting Nacos registry and configuration center, we allocated the same resources to JVM as Nacos, which is 2 Core 4 GiB.

The test results under this configuration are as follows:

Specification Nodes Concurrency Services Execution Time (ms) TPS
2 Core 4 GiB 1 30 1000 11003 2727.3
50 1000 15006 3333.3
100 500 13963 3580.9

Success

The TPS remains consistent with the previous results even after adjusting the JVM. This indicates that adjusting the JVM has minimal impact on the performance of Nacos.

Comments