Trouble with consolidating resources
A common approach is to look for tasks that have a similar profile concerning their scalability, lifetime, and processing requirements.
Grouping these together allows them to scale as a unit.
Generally, the more resources specified, the greater the cost.
To save money, it's important to maximize the work an expensive computational unit performs, and not let it become inactive for an extended period.
Ideally, tasks that share the same computational unit should exhibit different resource utilization characteristics.
If there are tasks that require a great deal of CPU power in short bursts, consider consolidating these into a single computational unit that provides the necessary power.
However, it's important to balance this need to keep expensive resources busy against the contention that could occur if they are over stressed.
Additionally, increasing the number of tasks running in a computational unit increases the attack surface of the unit.
Each task is only as secure as the one with the most vulnerabilities. If one task in a computational unit fails or behaves abnormally, it can affect the other tasks running within the same unit.