push_max_reserved_memory

The `push_max_reserved_memory` directive sets the maximum amount of memory reserved for push notifications in Nchan.

Syntaxpush_max_reserved_memory size;
Defaultnone
Contexthttp
Arguments1

Description

The push_max_reserved_memory directive is specifically designed to configure the maximum memory that can be reserved for storing push notifications in Nchan. As a scalable pub/sub server for Nginx, Nchan relies heavily on efficient memory usage to handle potentially millions of active connections. Setting this directive allows administrators to control the memory footprint of the server, ensuring that it does not exceed predefined limits based on the server's capacity.

This directive accepts a single argument, which specifies the size limit in bytes. It can take values such as 1m (one megabyte), 512k (512 kilobytes), etc. When the reserved memory reaches this threshold, further attempts to reserve memory for additional push notifications may fail, depending on the settings of other related directives. This functionality is vital for preventing excessive memory consumption that could lead to degraded performance or crashes, especially in environments with fluctuating loads.

Overall, configuring this directive appropriately is crucial for optimizing resource management within your Nchan application, allowing for smooth operation even under peak usage scenarios. Failing to set an appropriate limit may result in unexpected behavior, including service interruptions or excessive latency in message delivery.

Config Example

push_max_reserved_memory 10m;

Setting a value too low may result in lost messages during high usage peaks.

Do not forget to monitor memory usage to determine the optimal size for your environment.

← Back to all directives