Load balancing network traffic processing for workloads among processing cores
In general, techniques are described for dynamically load balancing among processing cores that a virtual router of a computing device uses to process network traffic associated with different workloads executing on the computing device. In some examples, a first computing device may assign, based on one or more metrics that indicate processing cores utilization or that indicate network traffic processing requirements for a workload that is to execute on a second computing device, network traffic processing for the workload to a first processing core of a plurality of processing cores of the second computing device. A virtual router, executing on the first processing core based on the assigning, may process network traffic for the workload.
1 . A method comprising:
determining, by a first computing device, based on one or more metrics that indicate processing cores utilization associated with a plurality of processing cores of a second computing device or that indicate network traffic processing requirements for a plurality of workloads that are to execute on the second computing device, assignment data that maps a workload of the plurality of workloads to a first processing core of the plurality of processing cores;
assigning, by the first computing device, based on the assignment data, network traffic processing for the workload to the first processing core of the plurality of processing cores of the second computing device;
processing, by a virtual router using the first processing core of the second computing device, based on the assigning of network traffic processing for the workload to the first processing core, network traffic for the workload;
classifying, by the first computing device, each of the plurality of workloads based on a first set of thresholds associated with networking requirements of the plurality of workloads;
classifying, by the first computing device, each of the plurality of processing cores based on a second set of thresholds associated with processing core utilization of the plurality of processing cores; and
determining, by the first computing device, whether the virtual router should process network traffic for the workload with a different, second processing core of the plurality of processing cores based on respective classifications of the plurality of workloads and respective classifications of the plurality of processing cores.
2 . The method of claim 1 , wherein the first computing device comprises one of
a controller for a network of servers comprising the second computing device, or
the second computing device.
3 . The method of claim 1 , wherein the workload is to execute on a third processing core that is different than the first processing core and the second processing core.
4 . The method of claim 1 , further comprising:
receiving, by the first computing device and from the virtual router, the one or more metrics.
5 . The method of claim 1 , further comprising:
in response to the first computing device determining the virtual router should process the network traffic for the workload with the second processing core, updating, by the first computing device, the assignment data to map the workload to the second processing core; and
processing, by the virtual router using the second processing core of the second computing device, based on the updated assignment data, network traffic for the workload.
6 . The method of claim 1 , further comprising assigning, by the first computing device, the workload to one processing core of the plurality of processing cores based on determinations of assignment data in periodic intervals.
7 . The method of claim 1 , wherein the one or more metrics comprises one or more of:
a number of packets sent from each of a plurality of workloads in a time interval, the plurality of workloads including the workload;
a number of packets received by each of the plurality of workloads in the time interval;
a number of bytes used by the virtual router to process network traffic for each of the plurality of workloads in the time interval; and
a processing core utilization of each of the plurality of processing cores in the time interval.
8 . The method of claim 1 , wherein:
classifying each of the plurality of workloads is further based on additional one or more metrics, and
wherein classifying each of the plurality of processing cores is further based on the additional one or more metrics.
9 . The method of claim 1 , wherein the first set of thresholds include a low workload threshold and a high workload threshold and wherein classifying each of plurality of workloads further comprises:
assigning, by the first computing device, a low workload classification to workloads with metric values below the low workload threshold;
assigning, by the first computing device, a medium workload classification to workloads with metric values above the low workload threshold and below the high workload threshold; and
assigning, by the first computing device, a high workload classification to workloads with metric values above the high workload threshold.
10 . The method of claim 1 , wherein the second set of thresholds include a low load threshold and a high load threshold and wherein classifying each of the plurality of processing cores further comprises:
assigning, by the first computing device, a low load classification to processing cores with metric values below the low load threshold;
assigning, by the first computing device, a medium load classification to processing cores with metric values above the low load threshold and below the high load threshold; and
assigning, by the first computing device, a high load classification to processing cores with metric values above the high load threshold.
11 . The method of claim 1 , further comprising:
generating, by the first computing device, a profile for a type of workload based on networking requirements of the type of workload; and
assigning, by the first computing device, a new workload that is the type of workload to the first processing core based on the profile.
12 . The method of claim 11 , wherein generating, by the first computing device, the profile for the workload comprises applying a machine learning model, wherein the machine learning model is trained to predict networking requirements of workloads that are the type of workload associated with the profile.
13 . The method of claim 1 , further comprising:
assigning, by the virtual router, a queue to the first processing core;
enqueueing, based on the assigning of network traffic processing for the workload to the first processing core, the network traffic for the workload to the queue; and
obtaining the network traffic for the workload based on the queue, prior to processing the network traffic for the workload.
14 . A computing system comprising processing circuitry having access to a storage device, the processing circuitry configured to:
determine, based on one or more metrics that indicate processing cores utilization associated with a plurality of processing cores of a computing device or that indicate network traffic processing requirements for a plurality of workloads that are to execute on the computing device, assignment data that maps a workload of the plurality of workloads to a first processing core of the plurality of processing cores;
assign, based on the assignment data, network traffic processing for the workload to the first processing core of the plurality of processing cores of the computing device;
instruct, based on assigning the network traffic processing for the workload to the first processing core, a virtual router using the first processing core of the computing device to process network traffic for the workload;
classify each of the plurality of workloads based on a first set of thresholds associated with networking requirements of the plurality of workloads;
classify each of the plurality of processing cores based on a second set of thresholds associated with processing core utilization of the plurality of processing cores; and
determine whether the virtual router should process network traffic for the workload with a different, second processing core of the plurality of processing cores based on respective classifications of the plurality of workloads and respective classifications of the plurality of processing cores.
15 . The computing system of claim 14 , wherein the processing circuitry is further configured to:
receive the one or more metrics from the virtual router.
16 . The computing system of claim 14 , wherein the processing circuitry is further configured to:
in response to determining the virtual router should process the network traffic for the workload with the second processing core, update the assignment data to map the workload to the second processing core; and
instruct, based on the updated assignment data, the virtual router of the computing device to process the network traffic for the workload using the second processing core.
17 . The computing system of claim 14 , wherein the processing circuitry is further configured to assign the workload to one processing core of the plurality of processing cores based on determinations of assignment data in periodic intervals.
18 . The computing system of claim 14 , wherein the processing circuitry is further configured to:
generate a profile for a type of workload based on networking requirements of the type of workload; and
assign a new workload that is the type of workload to the first processing core based on the profile.
19 . The computing system of claim 18 , wherein the processing circuitry is further configured to:
use a machine learning model to predict networking requirements of a type of workload; and
generate a profile for the type of workload based on predictions of the networking requirements of the type workload.
20 . A computing device comprising:
a plurality of processing cores having access to a storage device, the plurality of processing cores configured to:
obtain assignment data, wherein the assignment data is based on one or more metrics that indicate processing cores utilization associated with the plurality of processing cores or that indicate network traffic processing requirements for a plurality of workloads that are to execute on the computing device, and wherein the assignment data maps a workload of the plurality of workloads to a first processing core of the plurality of processing cores of the computing device;
process, by a virtual router using the first processing core of the plurality of processing cores, based on the assignment data mapping the workload to the first processing core, network traffic for the workload;
classify each of the plurality of workloads based on a first set of thresholds associated with networking requirements of the plurality of workloads;
classify each of the plurality of processing cores based on a second set of thresholds associated with processing core utilization of the plurality of processing cores; and
determine whether the virtual router should process network traffic for the workload with a different, second processing core of the plurality of processing cores based on respective classifications of the plurality of workloads and respective classifications of the plurality of processing cores.