---
name: "mysql-sysbench-oltp-benchmark"
description: "Simulate heavy transactional read/write workloads to benchmark database hardware and configurations."
metadata:
  author: "akopytov"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "benchmark mysql with sysbench"
  - "run sysbench oltp_read_write"
  - "measure mysql tps and latency"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Sysbench OLTP Database Benchmarking & Stress Testing

Measures MySQL and PostgreSQL throughput using Sysbench: generating test data tables, running OLTP complex read-write scenarios, measuring 99th percentile query latency, and detecting CPU/disk bottlenecks.

## When to Invoke
Invoke this skill whenever you need to:
- benchmark mysql with sysbench
- run sysbench oltp_read_write
- measure mysql tps and latency

## Execution SOP & Rules
1. Initialize benchmark schema: sysbench oltp_read_write --tables=10 --table-size=1000000 prepare.
2. Run multi-threaded test: sysbench oltp_read_write --threads=64 --time=300 --report-interval=10 run.
3. Analyze report metrics: Transactions Per Second (TPS), Queries Per Second (QPS), and 95th/99th latencies.
4. Clean up test data: sysbench oltp_read_write --tables=10 cleanup.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
