Resource optimized load balancing of microservice requests
Resource optimized forwarding of classified requests to different instances of a microservice is provided. The process includes obtaining classified requests to a microservice. The classified requests are classified based on different microservice resource consumption types. Further, the method includes forwarding the classified requests to instances of the microservice with different assigned resource configurations. The forwarding is based on the different microservice resource consumption types of the classified requests.
1 . A computer program product for facilitating processing within a computing environment, the computer program product comprising:
one or more computer-readable storage media and program instructions embodied therewith, the program instructions being readable by a processing circuit to cause the processing circuit to perform a method comprising:
classifying one or more unclassified request types to a microservice of the computing environment, the classifying comprising for a particular request type:
sending multiple digital requests of the particular request type to a group of instances of the microservice with different resource configurations, and monitoring digital response times thereof; and
based on the monitored digital response times, classifying the particular request type into one of multiple request classes of different microservice resource consumption types;
obtaining classified requests to the microservice, the classified requests being classified based on different microservice resource consumption types; and
forwarding the classified requests to instances of the microservice with different assigned resource configurations, the forwarding being based on the different microservice resource consumption types of the classified requests to enhance the computing environment's overall response time.
2 . The computer program product of claim 1 , wherein the instances of the microservice with different assigned resource configurations comprise instances of the microservice with different quantities of an assigned resource.
3 . The computer program product of claim 1 , wherein the instances of the microservice with different assigned resource configurations comprise instances of the microservice with multiple types of assigned resources with different quantities of assigned resources.
4 . The computer program product of claim 1 , wherein the classifying further comprises determining a microservice resource of the different resource configurations with which the particular request type is most performance-sensitive, and classifying the particular request type based, at least in part, thereon.
5 . The computer program product of claim 1 , wherein the classifying further comprises obtaining for each of the instances of the microservice, an average response time for the particular request type, and using the average response times, classifying the particular request into the one of the multiple request classes of different microservice resource consumption types.
6 . The computer program product of claim 1 , wherein the different resource configurations of the instances of the microservice comprise multiple resource types, the multiple resource types including CPU resources and memory resources.
7 . The computer program product of claim 6 , wherein for a particular resource type of the multiple resource types, different ones of the instances of the microservice have different respective resource configurations.
8 . The computer program product of claim 1 , further comprising monitoring response times of the classified requests forwarded to the instances of the microservice, and based on one or more monitored response times being below a specified threshold, reevaluating, at least in part, the classifying of the particular request type into the one of the multiple request classes of different microservice resource consumption types.
9 . A computer-implemented method comprising:
classifying one or more unclassified request types to a microservice of the computing environment, the classifying comprising for a particular request type:
sending multiple digital requests of the particular request type to a group of instances of the microservice with different resource configurations, and monitoring digital response times thereof; and
based on the monitored digital response times, classifying the particular request type into one of multiple request classes of different microservice resource consumption types;
obtaining classified requests to the microservice, the classified requests being classified based on different microservice resource consumption types; and
forwarding the classified requests to instances of the microservice with different assigned resource configurations, the forwarding being based on the different microservice resource consumption types of the classified requests to enhance the computing environment's overall response time.
10 . The computer-implemented method of claim 9 , wherein the instances of the microservice with different assigned resource configurations comprise instances of the microservice with different quantities of an assigned resource.
11 . The computer-implemented method of claim 10 , wherein the instances of the microservice with different assigned resource configurations comprise instances of the microservice with multiple types of assigned resources with different quantities of assigned resources.
12 . The computer-implemented method of claim 9 , wherein the classifying further comprises determining a microservice resource of the different resource configurations with which the particular request type is most performance-sensitive, and classifying the particular request type based, at least in part, thereon.
13 . The computer-implemented method of claim 9 , wherein the classifying further comprises obtaining for each of the instances of the microservice, an average response time for the particular request type, and using the average response times, classifying the particular request into the one of the multiple request classes of different microservice resource consumption types.
14 . The computer-implemented method of claim 9 , further comprising monitoring response times of the classified requests forwarded to the instances of the microservice, and based on one or more monitored response times being below a specified threshold, reevaluating, at least in part, the classifying of the particular request type into the one of the multiple request classes of different microservice resource consumption types.
15 . A computer system for facilitating processing within a computing environment, the computer system comprising:
a memory; and
at least one processor in communication with the memory, wherein the computer system is configured to perform a method, the method comprising:
classifying one or more unclassified request types to a microservice of the computing environment, the classifying comprising for a particular request type:
sending multiple digital requests of the particular request type to a group of instances of the microservice with different resource configurations, and monitoring digital response times thereof; and
based on the monitored digital response times, classifying the particular request type into one of multiple request classes of different microservice resource consumption types;
obtaining classified requests to the microservice, the classified requests being classified based on different microservice resource consumption types; and
forwarding the classified requests to instances of the microservice with different assigned resource configurations, the forwarding being based on the different microservice resource consumption types of the classified requests to enhance the computing environment's overall response time.
16 . The computer system of claim 15 , wherein the instances of the microservice with different assigned resource configurations comprise instances of the microservice with different quantities of an assigned resource.
17 . The computer system of claim 15 , wherein the instances of the microservice with different assigned resource configurations comprise instances of the microservice with multiple types of assigned resources with different quantities of assigned resources.