In Abiquo 2.4, you can 'auto recover' missed accounting periods (removing the need to run 'kinton_accounting.GenerateAccountingPeriodData' in ~90% of cases). Now, when the accounting process runs (hourly via the cron job), it detects the last hour of data that it processed, and continues from that point. To stop the auto-recovery process running away in the event of a large backlog of data to process, by default it will auto-recover no more than 24 accounting periods per cron job run (i.e. with the default settings, it will recover up to 24 hours worth of data each time the cron job runs).
Set these parameters in the kinton_accounting.accounting_parameters table.
Parameter Name: AccountingEnabled
Default Value: 1
Description: Controls if the accounting functionality is active or not.
Values: A value of 0 (or no parameter) means that no rows are calculated and added into the kinton_accounting.accounting_event_detail table. A non-zero value means that the accounting process is active.
Parameter Name: DeleteRegEventsUseSPParam
Default Value: 0
Description: Controls if the 'DeleteOldRegisteredEvents' stored procedure uses the supplied procedure parameter of the accounting_parameters table 'DeleteRegEventsDeleteHours' parameter to control the age of data in the kinton schema accounting_event_... tables given below or use the value passed as a parameter in the call to the stored procedure.
Values: The default value is 0 (I.e. Use the value from the accounting_parameters table).
Parameter Name: DeleteRegEventsDeleteHours
Default Value: 26280
Description: This controls the number of hours worth of 'old' data that should be held in the accounting_event_... tables. When this procedure is run (by default once per week on Sunday), it will remove any rows from the tables which are 'inactive' and older than the specified number of hours.
Values: The default value of 26280 hours means that data is held for approximately 3 years by default (three years of 365 days).
Parameter Name: AccountPeriodSize
Default Value: HOUR
Description: Controls the size of the aggregated account period of the accounting_event_detail table.
Values: It may be one of the following values: HOUR, DAY, WEEK, MONTH. If the value is bad or missing, the default value is used.
Parameter Name: AccountPeriodGranularity
Default Value: HOUR
Description: Controls the granularity of an accounting period, i.e. how many resource units are recorded - so for example, if account period = DAY and granularity = HOUR, then for a single CPU VM, Abiquo would record 24 resource units for the period; if account period = DAY and granularity = DAY, then Abiquo would record 1 resource unit.
Values: Possible values are HOUR, DAY, WEEK and MONTH. If the value is bad or missing, the default value is used.
Parameter Name: MaximumPeriodsToProcess
Default Value: 24
Description: If there are many missed accounting periods, this parameters controls how many can be processed in one call to the UpdateAccounting stored procedure. This setting ensures a degree of quality of service for the DBMS, minimizing the resource impact of recovering missed accounting data.
Values: The default value is 24, which would process 1 day of accounting data, assuming default settings for other parameters. The minimum number of periods to process is 1, and the maximum is 720 - if a value outside of this range is supplied, then the default value of 24 is used.
Use the ACCOUNTING_CONFIG_VW to view these parameters.