Use the ably bench publisher command to run a publisher benchmark test on an Ably channel.
Synopsis
ably bench publisher <channel-name> [options]Arguments
channel-name Required
The name of the channel to publish messages to.
Options
--message-size
The size of each message in bytes. The default value is 100.
--messages | -m
The number of messages to publish. The default value is 1000. The maximum value is 10000.
--rate | -r
The rate of messages per second. The default value is 15. The maximum value is 20.
--transport | -t
The transport protocol to use for publishing. Valid options are rest or realtime. The default value is realtime.
--wait-for-subscribers
Wait for subscribers to connect before publishing. The default value is false.
--client-id
The client ID to use for the benchmark.
--json
Output results as compact JSON. Mutually exclusive with --pretty-json.
--pretty-json
Output results in formatted JSON. Mutually exclusive with --json.
--verbose | -v
Enable verbose logging. Can be combined with --json or --pretty-json.
Examples
Run a basic publisher benchmark:
ably bench publisher my-channelRun a benchmark with custom message count and rate:
ably bench publisher my-channel --messages 5000 --rate 20Run a benchmark using the REST transport:
ably bench publisher my-channel --transport restRun a benchmark using the realtime transport:
ably bench publisher --transport realtime my-channelRun a publisher benchmark and output results in JSON format:
ably bench publisher my-channel --jsonSee also
- Bench — Explore all
ably benchcommands. - CLI reference — Full list of available commands.