Cloud Native 6 min read

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.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
How Nacos 2 Boosts Service Discovery Performance with Long‑Connection Architecture

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>&lt;dependency&gt;
    &lt;groupId&gt;com.alibaba.cloud&lt;/groupId&gt;
    &lt;artifactId&gt;spring-cloud-starter-alibaba-nacos-discovery&lt;/artifactId&gt;
    &lt;version&gt;2.2.5.RELEASE&lt;/version&gt;
    &lt;exclusions&gt;
        &lt;exclusion&gt;
            &lt;groupId&gt;com.alibaba.nacos&lt;/groupId&gt;
            &lt;artifactId&gt;nacos-client&lt;/artifactId&gt;
        &lt;/exclusion&gt;
    &lt;/exclusions&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;com.alibaba.cloud&lt;/groupId&gt;
    &lt;artifactId&gt;spring-cloud-starter-alibaba-nacos-config&lt;/artifactId&gt;
    &lt;version&gt;2.2.5.RELEASE&lt;/version&gt;
    &lt;exclusions&gt;
        &lt;exclusion&gt;
            &lt;groupId&gt;com.alibaba.nacos&lt;/groupId&gt;
            &lt;artifactId&gt;nacos-client&lt;/artifactId&gt;
        &lt;/exclusion&gt;
    &lt;/exclusions&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;com.alibaba.nacos&lt;/groupId&gt;
    &lt;artifactId&gt;nacos-client&lt;/artifactId&gt;
    &lt;version&gt;2.0.0&lt;/version&gt;
&lt;/dependency&gt;</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

Performancecloud-nativeservice discoveryNacosspring-cloud-alibabaLong Connection
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.