I have custom workers as Cloud services(classic) on Azure. I have scheduled autoscaling of amount of instances for business hours (5) and others (20).
Sometimes there is a problem when some workers are working with commands but it is the beginning of business hours, so instances are "killed" (scale down). As result commands aren't finished. Commands are messages from Azure queues. So basically that messages are returned to the queue. But it takes some time for another worker to grab that message again.
So the question - is there an automatic way of scaling workers only after they finished working with message/command?