I have an ECS cluster I'm deploying Docker images to using Fargate as the runtime. The containers run a process that consumes from a message broker queue. We'd like to define an autoscaling group that scales up and down based on a message broker's queue load. This isn't the issue here since we already know how to implement that.
The issue we have is that we have cronjobs which we know ahead of time are going to publish a lot of messages to the queue. If we rely on the queue's load as the only scaling metric, we will increase the cluster's capacity over time instead of pre-warming it and autoscaling to the maximum capacity. We'd rather consume those messages as soon as possible to ensure we avoid disrupting or delaying other asynchronous processes that are waiting to be executed.
Can we use both the target tracking policy and the scheduled policy at the same time? If that's the case, can we use the scheduled policy to increase the capacity to its maximum and rely on the target tracking policy to scale down?
If it is not possible, will a predictive scaling policy solve the issue? Do they work well? I haven't used them before.