Products | Versions |
---|---|
TIBCO Enterprise Message Service | - |
Not Applicable | - |
Resolution:
In TIBCO EMS, message swapping means that the server will write the serialized message on disk in order to free most of the message from memory. For PERSISTENT messages, the action of writing the message on disk is required, so swapping out the message only means freeing memory.
In some cases, NON_PERSISTENT messages may also be swapped-out. At that time, the server will write them on disk and then free the memory. Of course, those messages would not be recovered in case of a server failure, since they are NON_PERSISTENT.
A global parameter in tibemsd.conf drives the above behavior. The parameter "msg_swapping", if disabled, will prevent the server to free the message from memory. PERSISTENT messages will still be written on disk, but not freed from memory. NON_PERSISTENT messages would also never be swapped-out on disk.
The advantage of disabling message swapping is that no disk reads will be necessary when the server needs to send messages to consumers, since they are still in memory. The drawback is that they use more of the available memory (that can be limited with max_msg_memory) and therefore, the server can generally store less messages than when the parameter is enabled.
So, if msg_swapping is enabled, the EMS server will swap out messages when:
1. PERSISTENT messages are sent to a destination (queue, or offline durable subscribers) without consumers.
2. PERSISTENT messages are sent to a destination and the number of pending messages in that destination reaches a certain threshold, either in number or in size. Values are irrelevant and subject to change.
3. When the current Message Memory Usage reaches 75% of the max_msg_memory, or 8GB if max_msg_memory is configured to 0. Note that NON_PERSISTENT messages are affected by this condition. That is, even though, by contract, NON_PERSISTENT messages have no need to be persisted, the server uses the storage in order to offload the memory.