AMPS supports a pair of actions to help manage the size of the statistics database.
- amps-action-do-truncate-statistics removes statistics that are older than a certain amount
- amps-action-do-vacuum-statistics removes unused space in the statistics database to reduce the size of the file
Actions are configured in the Actions section of your AMPS configuration. You can set up actions to run on a timer, at a specific time of day, at a specific time of day on a specific day of the week, when AMPS starts up or shuts down, or in response to a Linux signal. For example, you could configure the actions like this to remove statistics older than one day and shrink the files, with the action running every day at 12:30 AM.
<Actions> <Action> <On> <Module>amps-action-on-schedule</Module> <Options> <Every>00:30</Every> <Name>Nightly Statistics Maintenance</Name> </Options> </On> <Do> <Module>amps-action-do-truncate-statistics</Module> <Options> <Age>1d</Age> </Options> </Do> <Do> <Module>amps-action-do-vacuum-statistics</Module> </Do> </Action> </Actions>
The full syntax for actions is described in the AMPS User Guide and AMPS Configuration Reference.
keywords: AMPS maintenance, statistics database size, statistics file size