Skip to content

Replace ab with locust for realistic load testing #638

@linconvidal

Description

@linconvidal

Problem

Current stability_test.py uses Apache Bench which sends identical payloads repeatedly:

  • Database caching heavily skews results
  • Doesn't reveal performance differences based on UTXO count, transaction history, or block size
  • Can't vary data per request
  • Unrealistic compared to production traffic patterns

Proposed Solution

Tool: Locust (Python-based load testing framework)

Key Benefits:

  • Read CSV with multiple rows, cycle through different data per request
  • Built-in p95/p99 percentile metrics
  • Real-time web UI for monitoring
  • Can weight endpoints differently (e.g., account/balance gets 10x more traffic than construction/metadata)
  • CI/CD friendly headless mode

Data Strategy

Create varied CSV files with diverse data profiles:

Address Diversity:

  • Light (1-10 UTXOs), Medium (100-1K UTXOs), Heavy (10K+ UTXOs)
  • New addresses (few txs) vs old addresses (thousands of txs)

Block Diversity:

  • Light blocks (1-5 txs) vs heavy blocks (100+ txs)
  • Recent blocks vs historical blocks

Transaction Diversity:

  • Small (<500 bytes) vs large (>10KB)
  • With/without metadata, with/without native assets

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions