Implementing Guaranteed Event Storage in Optimize
About this task
Guaranteed event storage functionality in Optimize uses a custom Monitor API (MAPI) configuration and batching techniques to deliver events and provide for enhanced notification of event delivery problems. When implemented appropriately, this functionality supports robust event delivery and, in the event of an event delivery problem, helps users correct problems before they cause significant data corruption. Also, it enables you to configure your system to persist cached event data to disk. Note that for most Optimize configurations, there is a trade-off between event delivery integrity and performance; there are several variables involved in this trade-off, and some experimentation may be necessary to achieve the desired balance for your system.
This feature includes two customer-configurable components that support guaranteed event storage.
- Setting a MAPI flag to support synchronous event delivery to Analytic Engines.
- Setting System Properties that determine whether system caches are configured for high event delivery integrity (persistence) or high performance.
Configuring the MAPI Flag
About this task
By default, events in Optimize are published by the Monitor API (MAPI) and handled asynchronously. This method provides optimal performance, but it means that users may not receive immediate notification of event publication errors. Using the flag described herein, you can configure the Optimize MAPI service to publish events synchronously. If an event delivery problem occurs in this configuration, errors are generated immediately.
The -Dsag.opt.mapi.sync.event.flag system property setting in the Integration Server startup file enables synchronous event delivery in all the components that use MAPI client mechanism running in the same Java Virtual Machine (JVM). It is important to remember that this flag is not limited to a single component; it can be set for any client JVM that uses the MAPI jar file.
Note that, depending on your system configuration, there may be multiple MAPI instances present in a system or JVM. In most cases, you can simply set the MAPI flag in the startup script for Integration Server or Infrastructure Data Collector or the custom build client application, etc.
To configure the MAPI flag on an Optimize system
Procedure
Disabling the MAPI Flag
About this task
If you want to disable the MAPI flag, you must remove the event flag line from the configuration file.
Note that, depending on your system configuration, there may be multiple MAPI instances and flags present in a system or JVM. For most typical systems, there will be a MAPI flag in the startup script for Integration Server or Infrastructure Data Collector or the custom build client application, etc.
To disable the MAPI flag on an Optimize system
Procedure
Setting System Cache Properties
About this task
This section explains how to set system cache properties to maximize event data integrity on an Optimize system. By default, the Optimize Analytic Engine caches event data in memory, which means that, in some cases, data can be lost if system components terminate or experience hardware failure. To provide enhanced event delivery integrity, this property enables you to configure an Optimize Analytic Engine to cache event data to disk so that event data is persisted even if a system component crashes or shuts down for some reason.
Note that disk caching can entail a significant performance penalty on some systems, especially those that process a large number of events; so making decision about caching options is often a matter of balancing performance vs. event integrity. When cache properties are configured for guaranteed event delivery, performance will be degraded to some degree, according to the specifics of your data and system configuration.
Basic cache configuration properties for the Analytic Engine are set using two parameters in the optimize\analysis\conf\wrapper.conf file. The first parameter specifies the desired level of event integrity. The second parameter specifies the local folder to use for persisting event data when it is cached to disk.
- Normal - This is the default setting, and it is equivalent to having disc caching disabled. For practical purposes, there is no reason to explicitly set event caching to this level.
- High - This setting saves event data to a specified disk location. However, event data is held in memory for some time, and if the Analytic terminates abnormally for some reason, that data could be lost. There is some performance degradation, though the exact amount depends on the specific system configuration and the amount of data being processed. The primary performance/event integrity trade-off occurs during Analytic Engine shutdown.
To enable disk caching on a system, you must add the appropriate lines to your wrapper.conf file to point to a valid folder on your system suitable for saving cache information, and you must specify the event guarantee level. The new caching information will take effect when you next start the system. If you implement disk caching, the persistence folder specified must have appropriate security configuration so that the user running the Analytic Engine has permission to write to the folder.
To set system cache properties:
Procedure
Disabling Disk Caching
About this task
Use the following procedure to disable disk caching on an Optimize system.
To disable disk caching
- Locate and open the wrapper.conf file in a text editor.
- Locate the caching configuration line and delete it. See the previous procedure for information about this line in various system configurations.
- Save the file and close it.