Upgrade to 2.6.0

Background

One customer noticed that deletes of old data required a lot of resources from the database server, and sometimes experienced timeouts. The investigation resulted in a couple of actions that will be implement in upcoming version of Async Manager, starting with 2.6.0 that deals with the lowest hanging fruits.

Create indexes

Async Manager version 2.6.0 creates the database indexes IX_OutRequest_InRequestId and IX_ActiveRequest_State_UpdatedAt in order to make purging old data more efficient. The creation operation can take a long time depending on how much data there is and the power of the database server.

The indexes are created as usual with database patcher (PATCH: 4), but only if it doesn't exist already.

Run this script

You should create these indexes manually before applying patch 4, just to be on the safe side (the database patching could get a connection timeout if the operation takes too long).

CREATE INDEX IX_OutRequest_InRequestId
  ON OutRequest (InRequestId)
  WITH (ONLINE=ON)
  
CREATE INDEX IX_ActiveRequest_State_UpdatedAt
  ON ActiveRequest (State, RecordUpdatedAt)
  WITH (ONLINE = ON)

After this, you can safely migrate the database to version 4.

Note that (ONLINE = ON) will improve performance since the table remains online for connectivity from other connections.

Tips: When this was run on a 50 DTU database with approximately 3 million rows, it took about 5 minutes to create IX_OutRequest_InRequestId. Depending on your situation consider temporarily boosting the database DTUs to make the query finish more quickly.

Background jobs

Not valid since 2.6.1

We have removed the support for individual cron expression in version 2.6.1

Async manager uses a couple of Azure functions to handle background tasks. Before version 2.6.0 there were two jobs. These have been separated and there are now six of them.

A new feature is that you can control the cron expressions yourself. The defaults are shown below. To override, add an app setting to your function app, e.g. "TimerTriggers:Purge" = "0 * * * * *"

{
  // Default timer trigger cron expressions
  "TimerTriggers": {
    "Purge": "0 */2 * * * *",
    "AwakeSleepingRequest": "0 */5 * * * *",
    "DeleteCompletedActiveRequests": "0 */5 * * * *",
    "EnqueueActiveRequests": "0 */5 * * * *",
    "SnoozeAwakeForNotActiveHosts": "0 */5 * * * *",
    "WakeupLimbo": "0 */5 * * * *"
  }
}