Closed mkdewidar closed 4 months ago
That's the expected behavior. If a client subscribes to a multiplexed channel, Nchan creates the demuxed channels individually, and joins them together in the multiplexed one.
Let's say, I have a subscriber multiplexing channels foo
and bar
. There are two message buffers, but three places to receive their data. Thus, Nchan counts this as 3 channels. (Also, as you've seen, 3 channels are allocated).
It may be odd but that's how Nchan counts channels for statistical purposes.
It seems that when a multiplexed channel connects, both the "memstore_multi" channel head and its child "memstore" channel heads count towards the "channels" statistic, instead of just the child channel heads.
In our use case, where a subscriber connects to either 1 or 2 multiplexed channels. We're finding that if we create a multiplexed subscription, the channels increase by 3, whereas if we create a single subscription it goes up by 1 (as expected).
NChan example config
When we connect with
/sub/foo,bar
and then check the status we see:But if we then connect with
/sub/far
and then check the status:We expect the "channels" metric to match the total number of individual channels that we've subscribed to, so in this case 3 (foo, bar and far).