主权项 |
1. A computer program product for process allocation, the computer program product comprising:
a non-transitory computer readable storage medium having computer usable program code embodied therewith, the computer usable program code configured to:
determine a set of two or more processes of a plurality of processes that share a resource of a plurality of resources in a multi-node system in which the plurality of processes are running, wherein each of the set of two or more processes is running on different nodes of the multi-node system;for each pair of the set of two or more processes and the resource, each pair comprising a first process of the set of two or more processes and a second process of the set of two or more processes,
calculate a first value for the first process, wherein the first value is calculated by a multiplication of a weight of the resource with a frequency of access of the resource by the first process, the weight indicating an importance of the resource;calculate a second value for the second process, wherein the second value is calculated by a multiplication of the weight of the resource with a frequency of access of the resource by the second process; andcalculate a score for the pair by addition of the first value to the second value;determine a highest priority pair of processes from among the set of two or more processes, the highest priority pair having a highest score, wherein the highest score is greater than scores of remaining pairs of processes from among the set of two or more processes;determine that the first value for the first process of the highest priority pair of processes is less than the second value for the second process of the highest priority pair of processes; andin response to determining that the first value for the first process of the highest priority pair of processes is less than the second value for the second process of the highest priority pair of processes, allocate the first process of the highest priority pair of processes from a first node in the multi-node system to a second node in the multi-node system, wherein the second node hosts the second process of the highest priority pair of processes. |