Coder Social home page Coder Social logo

nats-jetstream-perf's Introduction

Reproducing NATS Jet Streams performance benchmark results discussed here

  1. Install NATS Cluster to your envinronment

    # Create k8s secret with dummy TLS certs (valid for 2 years)
    kubectl create secret generic nats-tls --from-file=helm/tls
    
    # Install NATS Helm chart with values from the discussion
    helm repo add nats https://nats-io.github.io/k8s/helm/charts
    helm upgrade --install nats nats/nats -f helm/values.yaml
  2. Run NATS Bench

    # Open nats-box pod shell
    kubectl exec -it nats-box-{pod-tail} sh
    # Create 128 JetStreams (aka partitions)
    for i in $(seq 0 127); do
     nats stream add \
       --retention=limits \
       --storage=file \
       --replicas=3 \
       --discard=old \
       --dupe-window=2m \
       --max-age=-1 \
       --max-msgs=-1 \
       --max-bytes=-1 \
       --max-msg-size=-1 \
       --max-msgs-per-subject=-1 \
       --max-consumers=-1 \
       --allow-rollup \
       --no-deny-delete \
       --no-deny-purge \
       --subjects="events.*.$i" \
       "events-$i" > /dev/null
    done
    
    # Run load test profile 1 (sync). Expected result is ~35k RPS
    nats bench \
    --js \
    --multisubject \
    --pub 1280 \
    --msgs 7000000 \
    --size 100 \
    --syncpub \
    --no-progress \
    --stream "events-0" \
    "events"
    
    # Run load test profile 2 (async). Expected result is ~300k RPS
    nats bench \
    --js \
    --multisubject \
    --pub 1280 \
    --msgs 21000000 \
    --size 100 \
    --pubbatch 1000 \
    --no-progress \
    --stream "events-0" \
    "events"
    
    # Remove created JetStreams
     for i in $(seq 0 127); do nats stream rm -f "events-$i" > dev/null ;done
    
  3. Also, sample dotnet app can be used instead of nats-bench. It's code, sample k8s yaml, and grafana dashboard located in the dotnet-app directory

nats-jetstream-perf's People

Contributors

antonsmolkov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.