You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+86-12Lines changed: 86 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,29 +91,33 @@ Usage of ./pubsub-sub-bench:
91
91
-client-output-buffer-limit-pubsub string
92
92
Specify client output buffer limits for clients subscribed to at least one pubsub channel or pattern. If the value specified is different that the one present on the DB, this setting will apply.
93
93
-client-update-tick int
94
-
client update tick. (default 1)
94
+
client update tick in seconds. (default 1)
95
95
-clients int
96
96
Number of parallel connections. (default 50)
97
97
-cpuprofile string
98
98
write cpu profile to file
99
+
-data-size int
100
+
Payload size in bytes. In RTT mode, timestamp (13 bytes) + space + padding to reach this size. (default 128)
99
101
-host string
100
102
redis host. (default "127.0.0.1")
101
103
-json-out-file string
102
104
Name of json output file, if not set, will not print to json.
103
105
-max-number-channels-per-subscriber int
104
106
max number of channels to subscribe to, per connection. (default 1)
105
107
-max-reconnect-interval int
106
-
max reconnect interval. if 0 disable (s)unsubscribe/(s)ubscribe.
108
+
max reconnect interval in milliseconds. if 0 disable (s)unsubscribe/(s)ubscribe.
Max rps for publisher mode. If 0 no limit is applied and the DB is stressed up to maximum.
135
+
-rps-burst int
136
+
Max rps burst for publisher mode. If 0 the allowed burst will be the amount of clients.
129
137
-subscriber-prefix string
130
-
prefix for subscribing to channel, used in conjunction with key-minimum and key-maximum. (default "channel-")
138
+
prefix for subscribing to channel, used in conjunction with channel-minimum and channel-maximum. (default "channel-")
131
139
-subscribers-per-channel int
132
140
number of subscribers per channel. (default 1)
133
141
-subscribers-placement-per-channel string
134
142
(dense,sparse) dense - Place all subscribers to channel in a specific shard. sparse- spread the subscribers across as many shards possible, in a round-robin manner. (default "dense")
135
143
-test-time int
136
-
Number of seconds to run the test, after receiving the first message.
144
+
Number of seconds to run the test, after receiving the first message. Mutually exclusive with --messages.
137
145
-user string
138
146
Used to send ACL style 'AUTH username pass'. Needs -a.
139
147
-verbose
@@ -142,17 +150,83 @@ Usage of ./pubsub-sub-bench:
142
150
print version and exit.
143
151
```
144
152
145
-
### Example usage: create 10 subscribers that will subscribe to 2000 channels
153
+
## Examples
154
+
155
+
### Example 1: Create 10 subscribers that will subscribe to 2000 channels
The RTT mode will display average round-trip latency in milliseconds. The `--data-size` parameter ensures messages are 512 bytes (timestamp + padding).
205
+
206
+
### Example 4: Sharded Pub/Sub (SSUBSCRIBE/SPUBLISH)
subscribers_placement:=flag.String("subscribers-placement-per-channel", "dense", "(dense,sparse) dense - Place all subscribers to channel in a specific shard. sparse- spread the subscribers across as many shards possible, in a round-robin manner.")
251
251
channel_minimum:=flag.Int("channel-minimum", 1, "channel ID minimum value ( each channel has a dedicated thread ).")
@@ -254,19 +254,19 @@ func main() {
254
254
clients:=flag.Int("clients", 50, "Number of parallel connections.")
255
255
min_channels_per_subscriber:=flag.Int("min-number-channels-per-subscriber", 1, "min number of channels to subscribe to, per connection.")
256
256
max_channels_per_subscriber:=flag.Int("max-number-channels-per-subscriber", 1, "max number of channels to subscribe to, per connection.")
257
-
min_reconnect_interval:=flag.Int("min-reconnect-interval", 0, "min reconnect interval. if 0 disable (s)unsubscribe/(s)ubscribe.")
258
-
max_reconnect_interval:=flag.Int("max-reconnect-interval", 0, "max reconnect interval. if 0 disable (s)unsubscribe/(s)ubscribe.")
259
-
messages_per_channel_subscriber:=flag.Int64("messages", 0, "Number of total messages per subscriber per channel.")
257
+
min_reconnect_interval:=flag.Int("min-reconnect-interval", 0, "min reconnect interval in milliseconds. if 0 disable (s)unsubscribe/(s)ubscribe.")
258
+
max_reconnect_interval:=flag.Int("max-reconnect-interval", 0, "max reconnect interval in milliseconds. if 0 disable (s)unsubscribe/(s)ubscribe.")
259
+
messages_per_channel_subscriber:=flag.Int64("messages", 0, "Number of total messages per subscriber per channel. Mutually exclusive with --test-time.")
260
260
json_out_file:=flag.String("json-out-file", "", "Name of json output file, if not set, will not print to json.")
subscribe_prefix:=flag.String("subscriber-prefix", "channel-", "prefix for subscribing to channel, used in conjunction with key-minimum and key-maximum.")
264
+
subscribe_prefix:=flag.String("subscriber-prefix", "channel-", "prefix for subscribing to channel, used in conjunction with channel-minimum and channel-maximum.")
265
265
client_output_buffer_limit_pubsub:=flag.String("client-output-buffer-limit-pubsub", "", "Specify client output buffer limits for clients subscribed to at least one pubsub channel or pattern. If the value specified is different that the one present on the DB, this setting will apply.")
266
-
distributeSubscribers:=flag.Bool("oss-cluster-api-distribute-subscribers", false, "read cluster slots and distribute subscribers among them.")
266
+
distributeSubscribers:=flag.Bool("oss-cluster-api-distribute-subscribers", false, "read cluster slots and distribute subscribers among them (Redis OSS Cluster mode).")
version:=flag.Bool("version", false, "print version and exit.")
271
271
timeout:=flag.Duration("redis-timeout", time.Second*30, "determines the timeout to pass to redis connection setup. It adjust the connection, read, and write timeouts.")
272
272
poolSizePtr:=flag.Int(redisPoolSize, redisPoolSizeDefault, "Maximum number of socket connections per node.")
0 commit comments