Memory Reserve for Persistence Servers

Memory reserve is pre-allocated memory with which a persistence server could continue limited operations after exhausting available memory.

Caveat

For best results, avoid exhausting available memory. Techniques include pre-production resource allocation testing and appropriate configuration of the persistence store’s byte limit parameter.

Memory reserve does not guarantee continued operation, merely a best effort attempt. For example, other processes could interfere with memory reserve operation.

Background Information

Stored messages occupy process memory within a persistence server process. As a server accumulates message data from publishers, it allocates memory. As clients consume stored messages, the persistence server reclaims their memory.

If the operating system denies a request to allocate memory, the persistence server must discontinue normal operation. However, the server can continue partial service using its memory reserve.

Behavior

The following sequence describes the behavior of memory reserve:
  1. Message data growth exhausts available memory on the persistence server host computer.

    Such growth could indicate that subscribing clients are operating slowly, or not operating at all. Alternatively, the issue could result from high demand for memory by another process on the persistence server host computer.

  2. The persistence server rejects all new inbound data messages from publishing clients.
  3. Meanwhile, the persistence server attempts to use memory from the reserve for limited operation, for example, to continue replication, and to service data requests and acknowledgements from subscribing clients.
  4. The demand for memory subsides.
    Any of these factors can help reduce demand:
    • Subscribing clients consume and acknowledge stored messages.
    • Administrators selectively purge durables.
    • Other processes on the persistence server host computer deallocate memory.
  5. When the server can reallocate its full memory reserve, it resumes accepting and storing new messages from publishing clients.

Size

Administrators can specify the memory reserve using the command line parameter --mem-reserve. (See tibstore Command Line Reference.)

As a rule of thumb, reserve an additional 10% of the maximum expected volume of stored message data. For best results, test persistence server behavior in a pre-production environment, and adjust the size of the memory reserve accordingly.