Database CPU performance spike - job for resetting the budget of CI minutes available

The database has been under heavy CPU utilization with the last changes on the job for resetting the CI minutes available.

These spikes happened the last weekend : Screenshot_2021-02-01_at_08.46.24

Please review and refactor the monthly scheduled job for resetting the budget of CI minutes available to each namespace.

We need to consider also the impact on statistics and dead_tuples alerts after this job.

We had the following issues that relate to this problem:

I am adding a severity 2 label since there is a risk of collapse the primary database and generate a failover event and degradation of the service.

Acceptance criteria:

  • Reduce the impact on the database generated by the job.
  • fix the root cause that alerts generated after the execution of the job. (e. g. dead tuples alerts due to lack of autovacuum/vacuum...)
Edited by Jose Finotto