C

Cassandra / ScyllaDB

Protocol adapters available

One bound CQL statement per request over the native protocol.

Install
$ loadr plugin install cassandra
examples/plugins/cassandra.yaml
# Cassandra / ScyllaDB load test, driven by the `loadr-plugin-cassandra`
# native protocol plugin.
#
# Cassandra is NOT built into loadr core — it is a runtime-loadable plugin that
# speaks the CQL v4 binary protocol directly over TCP (no `scylla` /
# `cassandra-cpp` driver, no OpenSSL). The plugin hand-rolls the frame header,
# the STARTUP -> READY handshake, and one QUERY per request, parsing the RESULT
# row count. It declares the `cql://` URL scheme, so once installed a request to
# a `cql://` URL routes straight to it; no explicit `protocol:` is needed.
#
# Each request runs one statement from its `plugin:` block. loadr records the
# round-trip latency in `cassandra_req_duration` and counts statements in
# `cassandra_reqs`. Success is status 1 (the statement executed); a CQL error or
# a connection failure is status 0 and fails the request.
#
# Build + install the plugin, then run:
#   cargo build -p loadr-plugin-cassandra --release
#   mkdir -p dist && cp plugins/loadr-plugin-cassandra/plugin.toml dist/ \
#     && cp target/release/libloadr_plugin_cassandra.so dist/
#   loadr plugin install dist
#   loadr run examples/plugins/cassandra.yaml
#
# Or point the plan's `plugins:` entry at the built artifact directly (below).
name: cassandra
description: SELECT + INSERT against Cassandra / ScyllaDB via loadr-plugin-cassandra

plugins:
  # Resolve `cassandra` by name from the plugins dir (after `loadr plugin install`).
  # To run straight from a build tree instead, set:
  #   path: target/release/libloadr_plugin_cassandra.so
  - name: cassandra

scenarios:
  # Steady read pressure against a partition-keyed lookup.
  read:
    executor: constant-vus
    vus: 20
    duration: 30s
    flow:
      - request:
          name: read user
          url: cql://db.example.com:9042/loadr
          plugin:
            cql:
              query: SELECT id, email FROM users WHERE id = ?
              params: ["${vu}"]
              consistency: local_one
          checks:
            - { type: status, equals: 1 }               # 1 = ok, 0 = CQL error
            - { type: duration, name: query is fast, max: 250ms }

  # Fixed write rate against an events table.
  write:
    executor: constant-arrival-rate
    rate: 200
    duration: 30s
    pre_allocated_vus: 30
    max_vus: 100
    flow:
      - request:
          name: write event
          url: cql://db.example.com:9042/loadr
          plugin:
            cql:
              query: INSERT INTO events (id, kind, at) VALUES (?, ?, toTimestamp(now()))
              params: ["${vu}", "click"]
              consistency: local_quorum
          assert:
            - { type: status, equals: 1 }

thresholds:
  checks: [ "rate>0.99" ]
  cassandra_req_duration: [ "p(95)<100ms" ]
  cassandra_reqs: [ "count>0" ]

A real run: install from the signed index, then watch the plugin work.

A runtime plugin, never in the binary

Installing pulls a per-platform driver from the signed index, verifies its SHA-256 and checks its ABI before it ever loads. Remove it any time with loadr plugin remove cassandra.