Configuring Data Removal
When a Notification Services application runs, it accumulates data in the event, notification, and distribution tables, as well as in the control tables that Notification Services components use to coordinate their operation. If this data is not removed from the application database, it can cause the database to become very large and can hurt application performance. To avoid this situation, you can configure an automatic data removal process, called vacuuming.
The Data Removal Process
The Notification Services data removal process is called the vacuumer. The vacuumer deletes obsolete event, notification, and batch header data from the following tables in the application database:
- NSQuantum1
- NSRuleFirings1
- NSEventClassNameEventBatches
- NSEventClassNameEvents
- NSNotificationClassNameNotificationBatches
- NSNotificationClassNameNotifications
- NSDistributorWorkItems
- NSDistributionLog
Only event batches that have been processed, and data for notifications that have either been sent, expired, or failed with no more scheduled delivery attempts, are removed from the system.
The vacuumer limits the number of records it deletes at a time based on a maximum number of records per table. This limits the duration of each data removal interval, and allows the vacuumer to function without overtaxing system resources and application processing time.
Important
Data removal consumes significant database system resources. Run the data removal process only during periods of low system activity.
Retention Age
When you configure the vacuumer, you specify a retention age for event and notification data. When the vacuumer starts, it reads the system clock on the database server and then identifies all data that has reached the retention age.
When you specify the retention age, you need to determine how long you want to keep event and notification data. Because data removal also removes data from the distribution log, make sure you perform any necessary actions on that data before the data is older than its retention age.
The default retention age is seven days.
Schedule
When you configure the vacuumer, you also specify a schedule on which it runs. The schedule can contain multiple start times and durations.
- The start time, which is in UTC (Coordinated Universal Time or Greenwich Mean Time), specifies when the vacuumer should run.
- The duration specifies how long the vacuumer should run. The default duration is six hours, or until the next start time.
Important
There is no default data removal schedule. If you do not specify a data removal schedule, Notification Services will not remove old data from the application database.
The vacuumer checks once per minute to see if it should run. This can lead to a variation of up to a minute between the specified start time and the actual start time.
Each time the vacuumer completes a unit of work, it checks the system clock to see if it has exceeded the duration. It also checks the database to see if its associated application has been disabled. If either of these events has occurred, the vacuumer stops, logs a message in the event log, and sleeps until the next scheduled vacuuming interval.
When determining the vacuuming schedule, it is best to pick low-usage times for the application and the database server. If there are no low-usage times, you might want to run the data removal process more frequently so that less data is removed during each vacuuming period, which can minimize the impact on application performance.
To configure the data removal process
If you are defining an application through XML, configure data removal in the application definition file (ADF). If you are defining an application programmatically, use Notification Services Management Objects (NMO) to configure data removal.
- Vacuum Element (ADF)
- VacuumRetentionAge property (NMO)
- VacuumSchedules property (NMO)
See Also
Concepts
Specifying Application Execution Settings
Removing Obsolete Application Data