Configuring Memory Usage

Message Server Overview, Configuration Settings Appendix

(view configuration dialog)

Memory usage of the message server is governed by three things: the size of the IPC buffer, the serverís average memory usage, and the serverís maximum memory usage. These correspond to the message server configuration settings "IPC buffer size," "Average server mem," and "Max server mem." The IPC buffer size parameter determines the size of the memory mapped file that is used by all logging processes and by the message server. The average and maximum server memory usage parameters govern when the server deletes messages and when it suspends receipt of messages.

Message rolloff parameters in the server are strictly memory based. Rolling off messages based on aging algorithms ultimately doesnít make sense since ideally the goal would be to save everything and the only reason not to is to conserve memory. With indeterminate logging patterns and internal data compression itís impossible to know what an intelligent cutoff date or message count would be if the ultimate intent was simply to keep the memory usage to an acceptable value so Paul Bunyan uses the direct approach and will roll off messages as a function of memory usage.

The average memory consumption value is basically the desired static value that the message server will always use. That is to say that once a sufficient number of log messages come in to take up that much memory then that much memory will always be used since messages will only be rolled off when it is exceeded and thus triggers a purge of messages to take it minimally below that line. No more messages than necessary are deleted Ė itís a target memory threshold, not a maximum. Messages are not deleted until they have been presented to all message handlers, servers, and connected viewers. The intent is that if the destination handler or server is up and running or the viewer is connected then no messages should be missed and this is deemed to be more important than holding to the target memory usage. Only after a message has been presented all around is it flagged as a deletable candidate for memory purging. Message purging again, as with message dispatching, is done solely on low priority threads.

The maximum memory consumption value on the other hand is used exactly as that. If the maximum threshold is reached then the message server temporarily stops pulling messages out of the IPC buffer. Forwarding connections are also suspended. The IPC buffer is a pre-allocated chunk of shared memory and so takes up no more memory whether there are log messages stacking up or not, whereas it actually does take more memory to bring log messages out of the IPC buffer and into the server. The hope is that messages will temporarily and harmlessly pile up in the buffer while the server is freed up to dispatch and purge messages to get back below the threshold. Once the serverís memory usage is back down then it can hopefully start receiving messages again right where it left off with none being lost. If any have been lost then a notification message will be generated. The reason the observance of the memory cap takes precedence over the saving of messages is because the machine administrator has complete control over the memory cap while the converse is an open ended problem Ė if the server is persistently CPU starved on low priority threads then it will simply accrue messages ad infinitum.