incubator-seata icon indicating copy to clipboard operation
incubator-seata copied to clipboard

Seata Benchmark 1.0 Development Task

Open l81893521 opened this issue 3 months ago • 2 comments

Check Ahead

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

  • [ ] I am willing to try to implement this feature myself.

Why you need it?

As a distributed transaction solution, Seata's performance across different transaction modes is a key concern for users. Currently, there lacks a simple, focused tool to stress test various transaction modes (AT, TCC, Saga, etc.) and display critical table data changes in real-time.

How it could be?

Develop a command-line version Benchmark tool capable of stress testing Seata's transaction modes and displaying key information changes from the global transaction table (global_table) and branch transaction table (branch_table) in real-time during testing, enabling visual observation of transaction state transitions and performance metrics

Other related information

No response

l81893521 avatar Sep 19 '25 16:09 l81893521

Create a standalone benchmark module with a CLI tool to stress test Seata transaction modes (AT, TCC, Saga, XA) and display real-time metrics from global_table and branch_table.

Implementation Steps

  1. Create Benchmark Module
  • Add benchmark module to root pom.xml
  • Create benchmark/pom.xml with dependencies: server, core, metrics, JCommander
  • Set up package structure
  1. CLI Interface (JCommander)
  • Command-line options:
    • --mode: Transaction mode (AT/TCC/SAGA/XA/ALL)
    • --storage: Storage mode (db/file/redis/raft)
    • --threads: Number of concurrent threads
    • --duration: Benchmark duration (seconds)
    • --tps-target: Target transactions per second
    • --config: Path to Seata configuration
  1. Transaction Simulator
  • Mock GlobalSession and BranchSession creation
  • Use TransactionStoreManager to write sessions
  • Simulate transaction state transitions (Begin → Committing → Committed)
  • Support different transaction modes with appropriate branch types
  1. Metrics Collection
  • Track: TPS, Success Rate, Avg Latency, P95/P99 Latency
  • Query global_table for: total count, status distribution
  • Query branch_table for: total count, branch type distribution
  • Monitor storage layer performance
  1. Real-time Console Display
  • Live updating dashboard using ANSI escape codes
  • Show:
    • Current TPS and target TPS
    • Transaction counts by status (Begin/Committing/Committed/Rollback)
    • Branch counts by type (AT/TCC/SAGA/XA)
    • Table statistics refresh every second
    • Performance metrics (latency percentiles)
  1. Storage Adapter
  • Abstract interface to work with all storage modes
  • Use existing TransactionStoreManager implementations
  • Handle configuration for each storage type

Key Technical Details

  • Leverage existing classes: GlobalSession, BranchSession, TransactionStoreManager
  • Use ServerTableColumnsName constants for table queries
  • Support all BranchType enums: AT, TCC, SAGA, XA, SAGA_ANNOTATION
  • Thread pool for concurrent transaction generation
  • Graceful shutdown to ensure data consistency

This is a plan generated by AI. What do you think about it? If this issue is not urgent, I'd like to give it a try.

WangzJi avatar Oct 31 '25 07:10 WangzJi

Create a standalone benchmark module with a CLI tool to stress test Seata transaction modes (AT, TCC, Saga, XA) and display real-time metrics from global_table and branch_table. Implementation Steps

  1. Create Benchmark Module
  • Add benchmark module to root pom.xml
  • Create benchmark/pom.xml with dependencies: server, core, metrics, JCommander
  • Set up package structure
  1. CLI Interface (JCommander)
  • Command-line options:

    • --mode: Transaction mode (AT/TCC/SAGA/XA/ALL)
    • --storage: Storage mode (db/file/redis/raft)
    • --threads: Number of concurrent threads
    • --duration: Benchmark duration (seconds)
    • --tps-target: Target transactions per second
    • --config: Path to Seata configuration
  1. Transaction Simulator
  • Mock GlobalSession and BranchSession creation
  • Use TransactionStoreManager to write sessions
  • Simulate transaction state transitions (Begin → Committing → Committed)
  • Support different transaction modes with appropriate branch types
  1. Metrics Collection
  • Track: TPS, Success Rate, Avg Latency, P95/P99 Latency
  • Query global_table for: total count, status distribution
  • Query branch_table for: total count, branch type distribution
  • Monitor storage layer performance
  1. Real-time Console Display
  • Live updating dashboard using ANSI escape codes

  • Show:

    • Current TPS and target TPS
    • Transaction counts by status (Begin/Committing/Committed/Rollback)
    • Branch counts by type (AT/TCC/SAGA/XA)
    • Table statistics refresh every second
    • Performance metrics (latency percentiles)
  1. Storage Adapter
  • Abstract interface to work with all storage modes
  • Use existing TransactionStoreManager implementations
  • Handle configuration for each storage type

Key Technical Details

  • Leverage existing classes: GlobalSession, BranchSession, TransactionStoreManager
  • Use ServerTableColumnsName constants for table queries
  • Support all BranchType enums: AT, TCC, SAGA, XA, SAGA_ANNOTATION
  • Thread pool for concurrent transaction generation
  • Graceful shutdown to ensure data consistency

This is a plan generated by AI. What do you think about it? If this issue is not urgent, I'd like to give it a try.

Thank you very much for your response. You are welcome to give it a try. Could you leave your contact information?

l81893521 avatar Nov 15 '25 11:11 l81893521