How Nacos 2 Boosts Service Discovery Performance with Long‑Connection Architecture
The article explains Nacos 2's new long‑connection model built on gRPC, its performance gains over Nacos 1.x, compatibility details for configuration and discovery, Spring Cloud Alibaba integration, and provides download links and reference resources.
Nacos 2 Architecture Model
Nacos 2.X adds support for a long‑connection model on top of the 1.X architecture; the communication layer now uses gRPC to provide persistent RPC calls and push capabilities, dramatically reducing the frequent polling heartbeats that caused JVM Full GC in 1.x.
Performance Improvements
Performance tests focus on key functions using a three‑node cluster, showing interface load, capacity, and improvements compared with Nacos 1.X.
During stress testing, service and instance capacity reached the million‑level, with the cluster running stably as expected (this scenario does not include frequent push content caused by rapid changes; a real‑world push scenario will be covered in a later report).
Registration/Deregistration TPS exceeds 26,000, achieving at least a 2× improvement over Nacos 1.X.
Instance query TPS exceeds 30,000, roughly a 3× improvement over Nacos 1.X.
Compatibility
Configuration Center
Fully compatible with all 1.X client API methods.
Fully implements all 2.X client API methods.
Fully compatible with all configuration‑center related open APIs.
Service Discovery
Due to significant changes in the data model, some functions are temporarily unsupported.
Viewing the current cluster leader (to be deprecated), batch updating instance metadata (Beta, unsupported), and batch deleting instance metadata (Beta, unsupported) are listed.
Console
Fully compatible with configuration‑center related pages and functions.
Fully compatible with permission‑control related pages and functions.
Fully compatible with namespace related pages and functions.
Fully compatible with cluster‑management related pages and functions.
Fully compatible with service‑discovery related pages and functions.
Spring Cloud Alibaba Adaptation
Since Spring Cloud Alibaba 2.2.5 bundles nacos‑client 1.4.1, you can specify a newer nacos‑client to enable Nacos 2.0 long‑connection features early.
<code><dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>2.2.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>2.2.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>2.0.0</version>
</dependency></code>Download Links
GitHub download [1]
Domestic mirror [2]
Reference Materials
[1] https://github.com/alibaba/nacos/releases/download/2.0.0/nacos-server-2.0.0.zip
[2] https://mirror.pig4cloud.com/nacos/nacos-2.0.0.zip
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.