push_stream_max_number_of_wildcard_channels
The directive 'push_stream_max_number_of_wildcard_channels' limits the number of wildcard channels in the NGINX Push Stream Module.
Description
The 'push_stream_max_number_of_wildcard_channels' directive is used to configure the maximum number of wildcard channels that can be created in a specific NGINX context using the Push Stream Module. Wildcard channels are particularly useful when you want to allow subscribers to receive messages from multiple related channels without having to explicitly subscribe to each one. For example, a subscriber might subscribe to a channel like 'news.*' to receive messages from all channels that start with 'news'. By setting a limit on the number of these wildcard channels, administrators can prevent resource overuse and maintain system performance under high load.
When this directive is configured, it defines the upper bound for the wildcard channels that can be dynamically created as subscribers access channels matching a wildcard pattern. If the number of created channels exceeds this limit, additional subscriptions may be rejected or handled based on the module's internal logic. This helps maintain efficiency and ensures that the server does not become overwhelmed with excessive channel creation, which could lead to degraded performance.
The directive accepts a single integer argument that specifies the maximum number of wildcard channels. An improper configuration or neglecting to set this directive can result in unintended behaviors, including subscribers receiving fewer messages than expected due to channel rejection. Thus, careful consideration should be taken when adjusting this value to balance functionality and resource management safely.
Config Example
http {
push_stream_max_number_of_wildcard_channels 100;
server {
location /sub {
push_stream_subscriber;
push_stream_channels_path $arg_id;
}
}
}Setting this value too low may limit the functionality of wildcard subscriptions, causing subscribers to miss some messages.
Forgetting to set this directive may lead to performance issues as it defaults to no limit, potentially overwhelming the server with too many channels.