Understanding Grid Store Intervals

Grid stores are designed to ensure a quick EMS server start-up time. To enable this functionality, the EMS server must continually monitor stores in the background. The server reads through grid stores incrementally and discards stale data, such as purged and expired messages.

In order to keep the background activity from degrading server performance, the examination is performed in increments. The length of these increments and the amount of data processed each increment are controlled by two parameter settings. These parameters can be configured for each grid store.

The default parameter settings are optimized for best performance in most production environments (see Configuring Grid Stores for information about the default values). However, if the amount of data in a grid store grows significantly, the read rates associated with the background activity may begin to affect message transmission rates in the EMS server. If the EMS server performance is negatively affected by the size of the grid store, you can tune the grid store parameter values to spread grid store background activity over a longer period of time, thereby decreasing the associated read rates.

  • scan_target_interval: the maximum amount of time allowed before each message in the store is examined.

    For example, if the scan_target_interval is 24 hours, each section of the grid store will be examined at least once every day. Because purged and expired messages are not removed from the grid store until they are examined by this background process, this means that it can take up to 24 hours before a message is removed from the queue following a purge command (making underlying storage space available for re-use).

  • scan_iter_interval: the length of time between each increment of background activity.

    For example, if the scan_iter_interval is 10 seconds, the EMS server begins examining a new section of the grid store every 10 seconds. The amount of data read in each increment is dependent on the total size of the store and the length of the scan_target_interval. The server must examine enough data in each interval to fully traverse the store within the target interval.

Example

For example, assume that scan_iter_interval is 10 seconds, scan_target_interval is 1 day (86,400 seconds), and the grid store contains 9 GB of data. Every 10 seconds, the EMS server will examine about 1 MB of data. This produces an average read rate of about 100 KB/sec, which is unlikely to produce performance degradation with most modern storage mediums.

If EMS server performance does slow, you may need to increase the scan_target_interval value in order to spread the background activity over a longer period of time. You can monitor the settings for problems using the show store command and checking the ratio of "Discard Scan Interval Bytes" to "Discard Scan interval". For best results, this ratio should be kept below 20% of the system capacity. Adhering to this ratio will help ensure that the background activity does not occupy an excessive amount of system resources.