Skip to content

nhanth87/ussd-loadtest

Repository files navigation

USSD 10k TPS Load Test Suite

Tổng quan

Bộ công cụ load test USSD Gateway đạt 10,000 TPS (transactions per second). Hỗ trợ 2 chế độ test:

  1. MAP-level — Test trực tiếp SS7 stack (SCTP → M3UA → SCCP → TCAP → MAP)
  2. HTTP-level — Test qua HTTP interface của USSD Gateway (XML/HTTP → SBB)

MAP-Level Load Test (map-level/)

Cấu trúc

map-level/
├── lib/              # ~50 JAR dependencies (Netty 4.2.11, JCTools, Guava, Jackson XML, ...)
├── config/           # XML config files (Client_sctp.xml, Server config, SCCP router, ...)
├── scripts/          # Shell scripts chạy test
└── ussd_build.xml    # Ant build script

Cách chạy

cd map-level/

# 1. Server (chạy trước)
java -cp "lib/*" org.mobicents.protocols.ss7.map.load.ussd.Server \
  100000 50000 SCTP 192.168.1.10 192.168.1.11 8011 IPSP 101 1 2 147 101 8

# 2. Client (chạy sau)
java -cp "lib/*" org.mobicents.protocols.ss7.map.load.ussd.Client \
  100000 50000 SCTP 192.168.1.11 192.168.1.10 8011 IPSP 101 2 1 147 101 8 \
  "*100#" "UTF-8" 60000 10000 10000 2000

Tham số Client

# Tham số Ý nghĩa
1 NDIALOGS Tổng số dialog (vd: 100000)
2 MAXCONCURRENTDIALOGS Số dialog concurrent tối đa (vd: 50000)
3 channelType SCTP hoặc TCP
4 hostIp IP local
5 peerIp IP server
6 peerPort Port SCTP
7 asFunctionality IPSP / AS / SGW
8 routingContext Routing context
9 origPc Originating point code
10 destPc Destination point code
11 ussdSsn USSD SSN (thường 8 hoặc 147)
12 ussdString Nội dung USSD (vd: "*100#")
13 charset UTF-8
14 requestDelay Delay giữa các request (ms)
15 waitTps Thờ gian chờ đạt TPS ổn định
16 startTps TPS khởi đầu
17 stepTps TPS tăng mỗi bước

HTTP-Level Load Test (http-level/)

Cấu trúc

http-level/
├── lib/
│   └── loadtest-7.2.1-SNAPSHOT.jar    # HTTP load generator JAR
└── scripts/
    └── run-http-loadtest.sh           # Script chạy HTTP load test

Cách chạy

cd http-level/

# Chạy HTTP load generator
java -cp "lib/*" org.mobicents.ussd.loadtest.UssdHttpLoadGenerator \
  http://ussd-gateway:8080/ussdhttpdemo/ \
  10000      # target TPS \
  32         # worker threads \
  50000      # max concurrent dialogs \
  300        # test duration (seconds) \
  "*100#"    # USSD string \
  "http"     # protocol

Tham số UssdHttpLoadGenerator

Tham số Mặc định Ý nghĩa
baseUrl (bắt buộc) URL USSD GW servlet
targetTps 10000 TPS mục tiêu
workerThreads 32 Số thread worker
maxConcurrent 50000 Số request concurrent tối đa
testDurationSec 300 Thờ gian chạy test (giây)
ussdString "*100#" Nội dung USSD

Yêu cầu hệ thống

Thành phần Yêu cầu
Java JDK 8+ (Zulu JDK 8.84.0.15 khuyến nghị)
RAM Tối thiểu 4GB, khuyến nghị 8GB+ cho 10k TPS
JVM Heap -Xms4g -Xmx4g -XX:+UseG1GC
Network < 1ms latency giữa client và server
OS Linux (Ubuntu 20.04/22.04 khuyến nghị)

JVM Tuning cho 10k TPS

JAVA_OPTS="-Xms4g -Xmx4g \
  -XX:+UseG1GC \
  -XX:MaxGCPauseMillis=10 \
  -XX:+UnlockExperimentalVMOptions \
  -XX:+UseCGroupMemoryLimitForHeap \
  -XX:+HeapDumpOnOutOfMemoryError \
  -XX:HeapDumpPath=/var/log/ussd/ \
  -Djava.net.preferIPv4Stack=true"

Tuning kernel Linux

# /etc/sysctl.conf
net.core.somaxconn = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fin_timeout = 15
net.core.netdev_max_backlog = 65535
fs.file-max = 2097152
fs.nr_open = 2097152

# /etc/security/limits.conf
* soft nofile 1048576
* hard nofile 1048576

Build từ source

MAP-level

cd jSS7/map/load
mvn clean install -Passemble -DskipTests
# Output: target/load/

HTTP-level

cd ussdgateway/test/loadtest
mvn clean package -DskipTests
# Output: target/loadtest-7.2.1-SNAPSHOT.jar

Phiên bản

Component Version
jSS7 9.2.10
SCTP 2.0.13
USSD Gateway 7.2.1-SNAPSHOT
Netty 4.2.11.Final
JCTools 4.0.3
Jackson XML 2.15.2

Generated: 2026-04-21

About

High-performance USSD Gateway Load Test Suite - Target 10K TPS with HTTP and SS7 Loopback modes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors