  Modern data centres are increasingly adopting containers to enhance power and
performance efficiency. These data centres consist of multiple heterogeneous
machines, each equipped with varying amounts of resources such as CPU, I/O,
memory, and network bandwidth. Data centers rent their resources to
applications, which demand different amounts of resources and execute on
machines for extended durations if the machines provide the demanded resources
to the applications. Certain applications run efficiently on specific machines,
referred to as system affinity between applications and machines. In contrast,
others are incompatible with specific machines, referred to as anti-affinity
between applications and machines. We consider that there are multiple
applications, and data centers need to execute as many applications as
possible. Data centers incur electricity based on CPU usage due to the
execution of applications, with the cost being proportional to the cube of the
total CPU usage. It is a challenging problem to place applications on the
machines they have an affinity for while keeping the electricity cost in check.
Our work addresses the placement problem of matching applications to machines
to minimize overall electricity costs while maximizing the number of affinity
pairs of machines and applications. We propose three solution approaches: (a)
Power-Aware Placement (PAP): applications are placed on machines where power
usage is minimized, (b) Affinity-Aware Placement (AAP): applications are placed
on machines where affinity is maximized, (c) Combined Power-Affinity Placement
(CPAAP): this approach integrates the benefits of both PAP and AAP. Our
proposed approach improves the affinity satisfaction ratio by up to 4% while
reducing the total system cost by up to 26% and improving the affinity payoff
ratio by up to 37% compared to state-of-the-art approaches for real-life
datasets.
