Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Kafka Instance TPS

Updated on 2025-02-14 GMT+08:00

TPS tests can be performed in the following scenarios:

  • Scenario 1 (whether SASL is enabled): same topic, different SASL settings
  • Scenario 2 (synchronous or asynchronous replication): same instance, topics with different replication settings
  • Scenario 3 (synchronous or asynchronous flushing): same instance, topics with different flushing settings
  • Scenario 4 (disk type): same topic, instances with different disk types
  • Scenario 5 (number of partitions): same instance, topics with different number of partitions

Environment

Perform the following steps to set up the test environment.

  1. Purchase Kafka instances with parameters specified in Table 1. For more information, see Buying a Kafka Instance.
    Table 1 Instance parameters

    Instance Name

    Brokers

    Broker Flavor

    SASL

    Storage space per broker

    kafka-01

    3

    kafka.2u4g.cluster

    Yes

    Ultra-high I/O

    kafka-02

    3

    kafka.4u8g.cluster

    Yes

    Ultra-high I/O

    kafka-03

    3

    kafka.8u16g.cluster

    Yes

    Ultra-high I/O

    kafka-04

    3

    kafka.12u24g.cluster

    Yes

    Ultra-high I/O

    kafka-05

    3

    kafka.16u32g.cluster

    Yes

    Ultra-high I/O

    kafka-06

    3

    kafka.2u4g.cluster

    No

    Ultra-high I/O

    kafka-07

    3

    kafka.4u8g.cluster

    No

    Ultra-high I/O

    kafka-08

    3

    kafka.8u16g.cluster

    No

    Ultra-high I/O

    kafka-09

    3

    kafka.12u24g.cluster

    No

    Ultra-high I/O

    kafka-10

    3

    kafka.16u32g.cluster

    No

    Ultra-high I/O

    kafka-11

    3

    kafka.2u4g.cluster

    No

    High I/O

    kafka-12

    3

    kafka.4u8g.cluster

    No

    High I/O

    kafka-13

    3

    kafka.8u16g.cluster

    No

    High I/O

    kafka-14

    3

    kafka.12u24g.cluster

    No

    High I/O

    kafka-15

    3

    kafka.16u32g.cluster

    No

    High I/O

    After the purchase, obtain Address (Private Network, Plaintext) on the instance details page.

  2. Create topics with parameters specified in Table 2 for each instance purchased above. For details about how to create topics, see Creating a Kafka Topic.
    Table 2 Topic parameters

    Topic Name

    Synchronous Replication

    Synchronous Flushing

    Replicas

    Partitions

    topic-01

    No

    No

    3

    30

    topic-02

    Yes

    No

    3

    30

    topic-03

    No

    Yes

    3

    30

    topic-04

    No

    No

    3

    3

    topic-05

    No

    No

    3

    12

    topic-06

    No

    No

    3

    100

  3. Obtain the test tool.

    Obtain Kafka CLI v2.7.2.

  4. Purchase a server for the client.

    Buy a Linux ECS (with the same region, AZ, VPC, subnet, and security group as the Kafka instance). For details about how to purchase an ECS, see Purchasing a Custom ECS.

    Perform the following operations on the ECSs:

    • Install Java JDK and configure the environment variables JAVA_HOME and PATH.
      export JAVA_HOME=/root/jdk1.8.0_231 
      export PATH=$JAVA_HOME/bin:$PATH
    • Download Kafka CLI v2.7.2 and decompress it.
      tar -zxf kafka_2.12-2.7.2.tgz

Script

./kafka-producer-perf-test.sh --producer-props bootstrap.servers=${connection address} acks=1 batch.size=16384 linger.ms=10 --topic ${topic name} --num-records 10000000 --record-size 1024 --throughput -1 --producer.config ../config/producer.properties
  • bootstrap.servers: address of the Kafka instance obtained in 1.
  • acks: message synchronization policy. acks=1 indicates asynchronous replication, and acks=-1 indicates synchronous replication.
  • batch.size: size of messages sent in each batch, in bytes.
  • linger.ms: interval between two batches.
  • topic: topic name set in 2.
  • num-records: total number of messages to be sent.
  • record-size: size of each message.
  • throughput: number of messages sent per second.

Result

Scenario 1 (whether SASL is enabled): same topic (30 partitions, 3 replicas, asynchronous replication, and asynchronous flushing), instances with SASL enabled or disabled. The test result is as follows.

Table 3 Test results

Instance Flavor

Storage space per broker

Brokers

TPS (SASL Enabled)

TPS (SASL Disabled)

kafka.2u4g.cluster

Ultra-high I/O

3

100,000

280,000

kafka.4u8g.cluster

Ultra-high I/O

3

170,000

496,000

kafka.8u16g.cluster

Ultra-high I/O

3

200,000

730,000

kafka.12u24g.cluster

Ultra-high I/O

3

320,000

790,000

kafka.16u32g.cluster

Ultra-high I/O

3

360,000

1,000,000

Conclusion: When messages are produced to Kafka instances with the same flavor and topic but different access modes, instances without SASL show higher TPS than those with SASL.

Scenario 2 (synchronous/asynchronous replication): same instance (ultra-high I/O, three brokers, SASL disabled), topics with different replication settings, and number of producer processes is three. The test result is as follows.

Table 4 Test results

Instance Flavor

Synchronous Flushing

Replicas

Partitions

TPS (Synchronous Replication)

TPS (Asynchronous Replication)

kafka.2u4g.cluster

No

3

30

100,000

280,000

kafka.4u8g.cluster

No

3

30

230,000

496,000

kafka.8u16g.cluster

No

3

30

342,000

730,000

kafka.12u24g.cluster

No

3

30

383,000

790,000

kafka.16u32g.cluster

No

3

30

485,000

1,000,000

Conclusion: When messages are produced to different topics of a Kafka instance, topics with asynchronous replication show higher TPS than those with synchronous replication when other topic parameters are the same.

Scenario 3 (synchronous/asynchronous replication flushing): same instance (ultra-high I/O, three brokers, SASL disabled), topics with different flushing settings. The test result is as follows.

Table 5 Test results

Instance Flavor

Synchronous Replication

Replicas

Partitions

TPS (Synchronous Flushing)

TPS (Asynchronous Flushing)

kafka.2u4g.cluster

No

3

30

30,000

280,000

kafka.4u8g.cluster

No

3

30

32,500

496,000

kafka.8u16g.cluster

No

3

30

36,100

730,000

kafka.12u24g.cluster

No

3

30

37,400

790,000

kafka.16u32g.cluster

No

3

30

40,400

1,000,000

Conclusion: When messages are produced to different topics of a Kafka instance, topics with asynchronous flushing show significantly higher TPS than those with synchronous flushing when other topic parameters are the same.

Scenario 4 (different disk types): same topic (30 partitions, 3 replicas, asynchronous replication, and asynchronous flushing) with different disk types. The test result is as follows.

Table 6 Test results

Instance Flavor

Brokers

SASL

TPS (High I/O)

TPS (Ultra-High I/O)

kafka.2u4g.cluster

3

No

110,000

250,000

kafka.4u8g.cluster

3

No

135,000

380,000

kafka.8u16g.cluster

3

No

213,000

480,000

kafka.12u24g.cluster

3

No

240,000

577,000

kafka.16u32g.cluster

3

No

280,000

840,000

Conclusion: When messages are produced to the same topics of Kafka instances with the same flavor but different disk types, instances with ultra-high I/O disks show higher TPS than those with high I/O disks.

Scenario 5 (different numbers of partitions): same instance (ultra-high I/O, three brokers, SASL disabled), topics with different number of partitions. The test result is as follows.

Table 7 Test results

Instance Flavor

Synchronous Flushing

Synchronous Replication

Replicas

TPS (3 Partitions)

TPS (12 Partitions)

TPS (100 Partitions)

kafka.2u4g.cluster

No

No

3

250,000

260,000

250,000

kafka.4u8g.cluster

No

No

3

330,000

280,000

260,000

kafka.8u16g.cluster

No

No

3

480,000

410,000

340,000

kafka.12u24g.cluster

No

No

3

570,000

750,000

520,000

kafka.16u32g.cluster

No

No

3

840,000

1,000,000

630,000

Conclusion: When messages are produced to topics with different partition quantities of a Kafka instance, instances with more partitions show higher performance when other parameters are the same. However, performance reaches a peak and then deteriorates when partitions continue to increase.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback