Disk-Based Persistence and Message Swapping
You can control memory and disk usage with disk-based persistence and message swapping.
Use these approaches to manage a balance between memory use, messaging throughput (number of messages processed in a given time), and latency (time delay between message generation and delivery).
Disk-Based Persistence
Disk-based persistence is enabled on a by-cluster basis and, when enabled, only replicated stores perform disk persistence. Disk-based persistence is enabled in one of two modes, shown in the diagram that follows. For details, see TIBCO FTL Administration, Persistence Architecture, topic Disk-Based Persistence and Message Swapping.
-
Sync: The client returns from the send call after the message has been written to a majority of disks. This mode generally provides consistent data and robustness, but at the cost of increased latency and lower throughput.
-
Async: The client may return before the message has been written to a majority of disks. Calls to set or remove keys from a map may return before the set or remove has been written to disk by majority of the FTL servers.
This mode generally provides less latency and more throughput, but messages could be lost if a majority of persistence services fail simultaneously.
Figure 16: Disk-Based Persistence: Sync and Async
Disk Persistence Enabled Backup and Compaction
Backup and online compaction cannot run at the same time. For details on disk space considerations, see TIBCO FTL® - Enterprise Edition Administration, Persistence Service Disk Capacity, section "Disk Space for Backup or Compaction".
Backup
A backup operation is available for persistence clusters that have disk persistence enabled. The backup saves a snapshot of the persisted state, corresponding roughly to the time the backup was started. Backups proceed in the background, and do not prevent sending and receiving messages while in progress. The stored messages and metadata can be automatically recovered on a full restart of the persistence cluster. See Disk Persistence Backup and Restore.
Compaction
The persistence service can compact its disk persistence files while running without interruption to active publishers or subscribers. Alternatively, you can use a utility to compact persistence files for a given persistence service when the persistence service is not running. For details about compaction options, see TIBCO FTL® - Enterprise Edition Administration:
-
Compact Disk Persistence Files with Persistence Service Online
-
Compact Disk Persistence Files with Persistence Service Offline
Saving and Loading a Persistence State
You can also save and load a persistence state for in-memory or disk-based clusters. Clients are interrupted. For details, see TIBCO FTL® - Enterprise Edition Administration, topics Saving and Loading Persistence State, section "Restoring Backups".
Message Swapping
Messages held in process memory can be swapped to disk when message swapping is enabled per persistence cluster. Both replicated and non-replicated stores swap when swapping is enabled. Messages are swapped when configured memory limits are exceeded. The limit can be set on a per-store or per-durable basis. Adjusting these limits helps you to manage a balance between memory use, messaging throughput, and latency.