Reason for Channel Limit in NATS Streaming Server

358 views
Skip to first unread message

Frederik Fix

unread,
Oct 14, 2019, 11:52:58 AM10/14/19
to nats
Hello,

We are considering using NATS Streaming as a data store for an application using Event Sourcing.

The idea is to create a channel for every aggregate (top level entity). That means we will potentially have a very large number of channels.

In testing I got the error "Too many channels" and I saw the configuration parameter for the max number of channels.

What is the reason for having a channel limit? What are the scaling implications of having a large number of channels. If it matters we would be using the MySQL persistence backend.

Thanks in advance,
Frederik

Ivan Kozlovic

unread,
Oct 23, 2019, 3:25:53 PM10/23/19
to nats
Frederik

As you have seen, by default the Streaming server does limit the number of channels. This is configurable.
With file store implementation, a channel is persisted in a directory, each containing many files. So one of the resource limitations would be the number of file descriptors.
For other type of stores (you plan to use SQL) is simply memory. The server maintains some state in memory for a given channel, and of course, your database will have its own limits.
Reply all
Reply to author
Forward
0 new messages