Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stress test #84

Merged
merged 12 commits into from
Aug 9, 2021
Merged

Add stress test #84

merged 12 commits into from
Aug 9, 2021

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Aug 5, 2021

Signed-off-by: tabokie xy.tao@outlook.com

Build:

cargo build --release --workspace

Help output:

➜  raft-engine git:(benches) ✗ ./target/debug/stress --help
Engine Stress (stress) 
A stress test tool for Raft Engine

USAGE:
    stress [OPTIONS] --path <path>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --compression-threshold <size>     Compress log batch bigger than this threshold [default: 8KB]
        --compact-count <n>                Compact log entries exceeding this threshold [default: 0]
        --compact-ttl <ttl[ms]>            Compact log entries older than TTL [default: 0]
        --entry-size <size>                Set the average size of log entry [default: 1024]
        --force-compact-factor <factor>    Factor to shrink raft log during force compact [default: 0.5]
        --path <path>                      Set the data path for Raft Engine
        --purge-interval <interval[ms]>    Set the interval to purge obsolete log files [default: 10000]
        --purge-threshold <size>           Purge if log files are greater than this threshold [default: 10GB]
        --read-ops-per-thread <ops>        Set the per-thread OPS for read entry requests [default: 0]
        --read-threads <threads>           Set the thread count for reading logs [default: 0]
        --regions <regions>                Set the region count [default: 1]
        --target-file-size <size>          Target log file size for Raft Engine [default: 128MB]
        --time <time[s]>                   Set the stress test time [default: 60]
        --write-entry-count <count>        Set the average number of written entries of a region in a log batch [default: 4]
        --write-ops-per-thread <ops>       Set the per-thread OPS for writing logs [default: 0]
        --write-region-count <count>       Set the average number of written regions in a log batch [default: 4]
        --write-sync <sync>                Whether to sync write raft logs [default: true]
        --write-threads <write_threads>    Set the thread count for writing logs [default: 1]

Benchmark output:

➜  raft-engine git:(benches) ✗ ./target/debug/stress --path ./tmp --time 10 --regions 10 --write-threads 2 --read-threads 1 --read-ops-per-thread 100
[write summary]
Throughput(qps) = 6469.11
Latency(us) min = 119, avg = 273.03, p50 = 257, p90 = 363, p95 = 406, p99 = 490, p99.9 = 745, max = 2271
Fairness = 96.8%
[read summary]
Throughput(qps) = 98.88
Latency(us) min = 23, avg = 186.19, p50 = 180, p90 = 274, p95 = 288, p99 = 325, p99.9 = 609, max = 609
Fairness = 100.0%

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
…ches

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
src/engine.rs Outdated Show resolved Hide resolved
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
…ches

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@tabokie tabokie merged commit a21012f into tikv:master Aug 9, 2021
@tabokie tabokie deleted the benches branch August 9, 2021 05:13
@tabokie tabokie mentioned this pull request Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants