I didnt find any commands to know how many client subscribed a channel (subscribe) in redis... Somebody know?
Thanks,
You can use PUBSUB NUMSUB channel1 OR PUBSUB NUMSUB channel2 and get reply about the number of subscribers for the specified channel.
Regarding the number of subscribers and publishers, it is limited by the maxclients setting, 10,000 by default.
There is no hard limit in Redis on maximum number of channels; it is user configurable.
The CLIENT LIST command returns information and statistics about the client connections server in a mostly human readable format.
Publish
Return value
Integer reply: the number of clients that received the message.
That way when you publish to your channel, you be informed how many users are connected.
You could also keep track of this yourself using incr to increment counter when somebody subscribes to that channel and decr on unsubscribe to that channel. That way you can always know how many users are connected to that channel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With