Intelligent serverless function scaling
A system and method of serverless function scaling is described. The method may include receiving one or more types of serverless function invocations. The method also includes invoking one or more serverless functions and receiving metrics from the one or more serverless functions. The method also includes generating scaling heuristics for scaling of a number of serverless functions in view of the received metrics.
1. A system comprising:
a memory; and
a processing device, operatively coupled to the memory, to:
receive one or more types of serverless function invocations;
in response to receiving the one or more types of serverless function invocations, invoke one or more serverless functions;
receive metrics from the one or more serverless functions;
generate scaling heuristics for scaling of a number of serverless functions in view of the received metrics; and
scale the number of serverless functions in view of the scaling heuristics, wherein, to scale the number of serverless functions in view of the scaling heuristics, the processing device is to:
determine a rate to adjust the number of serverless functions in view of the scaling heuristics; and
adjust the number of serverless functions at the determined rate.
2. The system of claim 1 , wherein the metrics correspond to a latency of the one or more serverless functions.
3. The system of claim 1 , wherein the metrics correspond to an idle time of the one or more serverless functions.
4. The system of claim 1 , wherein the one or more types of serverless function invocations comprises a trigger function.
5. The system of claim 4 , wherein, to determine the rate to adjust the number of serverless functions in view of the scaling heuristics, the processing device is further to determine the rate to invoke the number of serverless functions in view of the scaling heuristics, and
wherein to adjust the number of serverless functions at the determined rate, the processing device is to invoke the number of serverless functions at the determined rate.
6. The system of claim 4 , wherein, to determine the rate to adjust the number of serverless functions in view of the scaling heuristics, the processing device is to determine the rate to remove the number of serverless functions in view of the scaling heuristics, and
wherein, to adjust the number of serverless functions at the determined rate, the processing device is to remove the number of serverless functions at the determined rate.
7. The system of claim 1 , wherein the one or more serverless functions correspond to containers.
8. The system of claim 1 , wherein the one or more serverless functions correspond to virtual machines.
9. A non-transitory computer-readable storage medium including instructions that, when executed by a processing device, cause the processing device to:
determine corresponding quantities of one or more types of serverless function invocations;
determine, by the processing device, whether the corresponding quantities of at least one of the one or more types of serverless function invocations satisfies a threshold;
in response to determining that the corresponding quantities of the at least one of the one or more types of serverless function invocations satisfies the threshold, identify a first rate to scale a number of serverless functions; and
scale the number of serverless functions in view of the first rate.
10. The non-transitory computer-readable storage medium of claim 9 , wherein the processing device is further to:
in response to determining that the corresponding quantities of the at least one of the one or more types of serverless function invocations does not satisfy the threshold, identify a second rate to scale a number of serverless functions; and
scale the number of serverless functions in view of the second rate.
11. The non-transitory computer-readable storage medium of claim 10 , wherein the first rate is greater than the second rate.
12. A method, comprising:
receiving one or more types of serverless function invocations;
in response to receiving the one or more types of serverless function invocations, invoking one or more serverless functions;
receiving metrics from the one or more serverless functions;
generating, by a processing device, scaling heuristics for scaling of a number of serverless functions in view of the received metrics; and
scaling the number of serverless functions in view of the scaling heuristics, wherein scaling the number of serverless functions in view of the scaling heuristics comprises:
determining a rate to adjust the number of serverless functions in view of the scaling heuristics; and
adjusting the number of serverless functions at the determined rate.
13. The method of claim 12 , wherein the metrics correspond to a latency of the one or more serverless functions.
14. The method of claim 12 , wherein the metrics correspond to an idle time of the one or more serverless functions.
15. The method of claim 12 , wherein the one or more types of serverless function invocations comprises a trigger function.
16. The method of claim 15 , wherein determining the rate to adjust the number of serverless functions in view of the scaling heuristics comprises determining the rate to invoke the number of serverless functions in view of the scaling heuristics, and
wherein adjusting the number of serverless functions at the determined rate comprises invoking the number of serverless functions at the determined rate.
17. The method of claim 15 , wherein determining the rate to adjust the number of serverless functions in view of the scaling heuristics comprises determining the rate to remove the number of serverless functions in view of the scaling heuristics, and
wherein adjusting the number of serverless functions at the determined rate comprises removing the number of serverless functions at the determined rate.
18. The method of claim 12 , wherein the one or more serverless functions correspond to containers.
19. The method of claim 12 , wherein the one or more serverless functions correspond to virtual machines.