Patent Description:
With the number of customers of a computing platform increasing, the demands on resources provided by the computing platform are also increasing. In some examples, customers are running their applications on multiple instances across the computing platform with certain resources allocated to each instance. Each instance, for example, includes a virtual server running on a particular host machine of the computing platform, and offers different compute and memory capabilities and resources. Thus, managing instances and resources across a computing platform becomes increasingly more complex with the number of instances and the amount of resources increasing. For example, conventional computing platforms are generally not very efficient in utilizing resources allocated to particular instances of the computing platform. In another example, conventional computing platforms are not easily stood up multiple times for an increased number of customers.

Hence it is highly desirable to improve the techniques for terminating instances and autoscaling instance groups on computing platforms. <CIT> discloses an approach for enabling a user to specify a termination policies used to select which instances in a group of virtual machines should be terminated. <CIT> discloses a method for identifying an instance of a virtual machine to evict.

Depending upon embodiment, one or more benefits may be achieved. These benefits and various additional objects, features and advantages of the present invention can be fully appreciated with reference to the detailed description and accompanying drawings that follow.

Conventional systems and methods are often not capable of efficiently utilizing resources allocated to instances on a computing platform at any given time.

In some embodiments, benefits include significant improvements, including, for example, increased efficiency and speed, in standing up a computing platform multiple times for an increased number of customers. In certain embodiments, other benefits include improved utilization of resources allocated to instances across the computing platform, and increased security and enhanced resiliency of the operating platform. Benefits of some embodiments include maximizing the percentage of provisioned resources that are allocated to pods by the computing platform at any given time. In some embodiments, systems and methods are configured to terminate instances and/or autoscale instance groups of a computing platform.

In certain embodiments, one or more solutions rooted in computer technology overcome one or more problems specifically arising in the realm of computer technology. Some embodiments are directed to computing platforms including instance groups. More particularly, some embodiments of the present invention provide systems and methods for terminating instances and autoscaling instance groups of computing platforms. In some examples, an instance running on the computing platform is associated with an instance group. In certain examples, an instance includes a virtual server or virtual machine. In other examples, an instance includes a virtual computing environment that provides an operating system and/or an application server for running one or more containers. For example, a container includes a containerized application. In some examples, one or more instances run on a server or host machine of the computing platform and are associated with particular resources that include CPU, memory, storage, and/or networking capacity. In certain examples, an instance group is associated with one or more instances.

<FIG> is a simplified diagram showing a system <NUM> for terminating instances and/or autoscaling instance groups of a computing platform <NUM> according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. The system <NUM> includes the computing platform <NUM>, a network <NUM>, and one or more client devices <NUM>. In some examples, the computing platform <NUM> includes a control plane application <NUM>. For example, the control plane application <NUM> includes an autoscaler <NUM>. As an example, the control plane application <NUM> includes a terminator <NUM> and a termination dispatcher <NUM>. In one example, the control plane application <NUM> includes a scheduler <NUM>.

According to some embodiments, instance groups <NUM><NUM>-N represent instance groups <NUM><NUM>,. , <NUM>N as shown in <FIG>, instances <NUM><NUM>-m represent instances <NUM><NUM>,. , <NUM>m as shown in <FIG>, instances <NUM><NUM>-n represent instances <NUM><NUM>,. , <NUM>n as shown in <FIG>, and instances <NUM><NUM>-k represent instances <NUM><NUM>,. , <NUM>k as shown in <FIG>. In certain examples, the computing platform includes one or more instance groups <NUM><NUM>-N. For example, each instance group <NUM><NUM>-N is associated with one or more instances <NUM><NUM>-m,. , <NUM><NUM>-n, respectively. As an example, an instance is associated with only one instance group. In other examples, the computing platform includes one or more detached instances <NUM><NUM>-k that are not associated with any instance group <NUM><NUM>-N.

In some embodiments, the computing platform <NUM> includes a cluster computing platform including one or more server or host machines. In some examples, the computing platform <NUM> includes a distributed computing platform that allows the one or more device clients <NUM> to distribute applications and/or data over the network <NUM> to a cluster of servers or host machines. In certain examples, the computing platform <NUM> includes a cloud computing platform that allows the one or more device clients <NUM> access to remote servers, data storages, networks, devices, applications and/or data resources over the network <NUM>. For example, multiple users through the one or more client devices <NUM> store data at the data storages of the cloud computing platform. In other examples, the computing platform <NUM> is associated with a platform provider that provides the platform to multiple customers. For example, customers of the computing platform <NUM> include individuals, organizations and/or commercial companies.

In certain embodiments, the one or more servers or host machines are divided into in one or more regions. For example, a region represents a geographic area that the one or more servers or host machines are located within. As an example, each region relates to a different geographic area. In other examples, each region of the one or more servers or host machines includes one or more separate zones. For example, each server or host machine within a region is associated with only one zone of the one or more separate zones associated with the region. As an example, each zone within a region are isolated from any other zone within the region. In one example, each zone within a region is connected with any other zone within the region through low-latency links. In some examples, the computing platform <NUM> is configured to not replicate applications and/or resources across different regions. For example, each region is completely independent from any other region of the computing platform <NUM>.

According to some embodiments, the computing platform <NUM> includes a container-orchestration platform. In some examples, the container-orchestration platform allows for automated deployment, scaling and/or operations of containers across the platform. For example, the container-orchestration platform employs the containers across one or more instances of the computing platform <NUM>.

According to certain embodiments, a container of the computing platform <NUM> includes one or more applications. In some examples, the container also includes data and libraries associated with the one or more applications. For example, the container allows the one and more applications and their associated data and libraries to be co-located on the same server or host machine. In one example, the container allows the one and more applications and their associated data and libraries to share resources. For example, the shared resources include CPU, memory, storage, and/or networking capacity. As an example, the container represents the lowest level of a micro-service of the computing platform <NUM>. In one example, the micro-service includes the one or more applications, libraries and the applications' dependencies.

In some embodiments, the scheduler <NUM> is configured to, in response to receiving an unscheduled pod from the one or more client devices <NUM>, select one instance from the instances <NUM><NUM>-m, <NUM><NUM>-n of the computing platform <NUM> for running the unscheduled pod. For example, the scheduler <NUM> is configured to select the one instance based at least in part on the availability of resources associated with the selected instance. As an example, each instance group <NUM><NUM>-N is assigned a minimum size of resources and a maximum size of resources. In some example, a pod of the computing platform <NUM> represents a basic scheduling unit of work on the computing platform <NUM>. In certain examples, the pod includes one or more containers. In other examples, one or more pods of the computing platform <NUM> provide a service to the one or more client devices <NUM>. In some examples, the scheduler <NUM> is configured to not schedule pods on any instances identified as unschedulable. In certain examples, the scheduler <NUM> is configured to monitor use of resources of each instance to ensure that workload is not scheduled in excess of available resources.

In certain embodiments, the scheduler <NUM> is configured to a new custom resource to the computing platform <NUM> called Demand. For example, Demand is an expression of a demand that could not be scheduled together. In some examples, the Demand includes: an instance group label that a demand is for; a list of demand units, e.g., a standard CPU resources, a standard memory resource, a count of discrete demand units; an owner reference that points to the job that caused the demand; and a status that includes: empty (the initial stage), pending (autoscaler has seen the demand), in-progress (autoscaler has started provisioning resources for the demand), fulfilled (autoscaler has satisfied the demand), and cannot fulfill (if a single demand unit exceeds what can be provided in a single instance group increment, i.e., the default instance size). In certain examples, the one or more client devices <NUM> are responsible for both creating a Demand resource and deleting the Demand resource. For example, in the case of a Spark scheduler, the scheduler <NUM> is configured to create a Demand resource per Spark job that the scheduler <NUM> fails to schedule due to a lack of resources. As an example, the Demand resource includes two demand units, one for the driver and a second one for all the executors. In some examples, at any point in time, a Demand resource can be deleted if the associated job has been scheduled. For example, it is possible that the autoscaler <NUM> already started the process of increasing capacity and the scale-down process is allowed to reclaim the potential excess capacity. As an example, once the additional capacity is online, the autoscaler <NUM> is configured to change the Demand resource to fulfilled. In one example, once the one or more client devices <NUM> are able to schedule a job, the autoscaler <NUM> is configured to delete the Demand resource associated with the job.

According to embodiments, the terminator <NUM> of the computing platform <NUM> is configured to terminate an instance of the one or more instances <NUM><NUM>-m, <NUM><NUM>-n associated with the instance groups <NUM><NUM>-N. The autoscaler <NUM> and/or the scheduler <NUM> are configured to associate a new instance with the instance group of the terminated instance. The terminated instance is replaced with a new instance in the instance group of the terminated instance. The terminator <NUM> is configured to terminate an instance in response to the instance being identified as eligible for termination. For example, the terminator <NUM> is configured to evaluate on a continuous basis whether an instance associated with an instance group is eligible for termination. In some examples of scaling up instance groups, the autoscaler <NUM> is configured to run bin packing, including the pods that were deemed unschedulable by the scheduler <NUM>, and scale up the number of bins (instances) that the autoscaler <NUM> requires bin packing pods while respecting utilization targets and/or maximum job latency. In certain examples of scaling down instance groups, the autoscaler <NUM> is configured to periodically evaluate instances that are below utilization targets and attempt to terminate ones that are least impactful based on runtime and/or priority. In other examples, the autoscaler <NUM> is configured to scale down instance groups in the least destructive way possible, initially preferring to allow all pods to exit gracefully at the cost of utilization over pre-empting pods before the pods run to completion to increase efficiency.

According to embodiments, the terminator <NUM> is configured to identify an instance of an instance group as eligible for termination in response to the instance meeting one or more predetermined eligibility conditions. For example, the predetermined eligibility conditions allow for flexibility regarding termination of particular instances. In some examples, the one or more predetermined eligibility conditions include the condition that a software upgrade is provided by the computing platform <NUM> for the instance and/or the instance group. In certain examples, the one or more predetermined eligibility conditions include the condition that a runtime of the instance is equal to or larger than a predetermined maximum lifetime. For example, the runtime of the instance represents a period of time when the instance is running and that starts at a time when the instance is launched. In other examples, the one or more predetermined eligibility conditions include the condition that the instance <NUM><NUM>-k is detached from any instance group <NUM><NUM>-N of the computing platform <NUM>. In yet other examples, the one or more predetermined eligibility conditions include the condition that the runtime of the instance is larger than a predetermined minimum lifetime.

In some embodiments, the terminator <NUM> is configured to identify an instance of an instance group as eligible for termination if the terminator <NUM> determines that the computing platform <NUM> provides a software upgrade for the instance and/or the instance group associated with the instance. For examples, the software upgrade includes a critical upgrade and/or a noncritical upgrade for the instance and/or the instance group. As an example, a critical upgrade includes an upgrade required to be applied to the instance and/or the instance group before the planned end-of-life of the instance. In one example, a critical upgrade includes an upgrade having security remediations for the instance, the instance group, and/or the computing platform <NUM>. In certain examples, the terminator <NUM> is configured to identify an instance as eligible for termination only if the software upgrade of the instance is determined to be critical. In other examples, the terminator <NUM> is configured to identify an instance as eligible for termination if the software upgrade of the instance and/or the instance group associated with the instance is determined to be safe. For example, a software upgrade is determined to be safe if upgrading does not disrupt or negatively affect the operation of the instance and/or the instance group. In some examples, the terminator <NUM> is configured to identify an instance as eligible for termination if the software upgrade is related to an infrastructure upgrade of the instance group associated with the instance.

In some examples, the terminator <NUM> is configured to determine that the computing platform <NUM> provides a software upgrade for the instance and/or the instance group if a version number of the provided upgrade differs from a version number associated with the instance group. For example, each instance group <NUM><NUM>-N and the instances <NUM><NUM>-m, <NUM><NUM>-n of each instance group <NUM><NUM>-N are associated with a particular version number, respectively. As an example, the terminator <NUM> is configured to determine that a software upgrade is provided for the instance and/or the instance group if the provided upgrade includes a higher version number than the version number associated with the instance and/or the instance group.

In certain embodiments, the terminator <NUM> is configured to identify an instance of an instance group as eligible for termination if the terminator <NUM> determines that the runtime of the instance is equal to or larger than a predetermined maximum lifetime. For example, the predetermined maximum lifetime is equal to <NUM> hours. As an example, the predetermined maximum lifetime is equal to <NUM> hours. In one example, the predetermined maximum lifetime is equal to <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, or <NUM> hours. For examples, the predetermined maximum lifetime represents a particular time period that is within a range from <NUM> hours to <NUM> hours. In some examples, the predetermined maximum lifetime for each instance of the computing platform <NUM> is the same. In certain examples, the terminator <NUM> is configured to immediately terminate each instance including runtimes that are equal to or larger than the predetermined maximum lifetime to improve security and resiliency of the computing platform <NUM>. For example, the terminator <NUM> is configured to terminate all instances including runtimes that are equal to or larger than the predetermined maximum lifetime regardless of the instances' operating condition at the time of termination. As an example, the terminator <NUM> is configured to ensure that no instance continuously operates for a runtime exceeding the predetermined maximum lifetime.

According to some embodiments, the terminator <NUM> is configured to identify an instance of an instance group as eligible for termination if the terminator <NUM> determines that the instance is not associated with the instance groups <NUM><NUM>-N of the computing platform <NUM>. For example, the instance is not associated with any instance group <NUM><NUM>-N in response to the instance being detached from the instance group associated with the instance. As an example, the detached instance <NUM><NUM>-k is still running on the computing platform <NUM>. In one example, the detached instance <NUM><NUM>-k runs to completion while being managed by the computing platform <NUM>. The scheduler <NUM> is configured to, in response to an instance being detached from the instance group, prepare a new instance as operational and to associate the new operational instance with the instance group of the detached instance. For example, preparation of the new instance includes associating a version number with the new instance. As an example, the version number of the new instance and a version number of the instance group associated with the new instance are the same.

According to certain embodiments, the terminator <NUM> is configured to identify an instance of an instance group as eligible for termination if the runtime of the instance is larger than a predetermined minimum lifetime. For example, the predetermined minimum lifetime is equal to <NUM> hours. As an example, the predetermined minimum lifetime is equal to <NUM> hours. In one example, the predetermined minimum lifetime is equal to <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, or <NUM> hours. For examples, the predetermined minimum lifetime represents a particular time period that is within a range from <NUM> hours to <NUM> hours. In some examples, the predetermined minimum lifetime for each instance of the computing platform is the same. In certain examples, the predetermined minimum lifetime is smaller than the predetermined maximum lifetime.

In some embodiments, the terminator <NUM> is configured to identify the instance as eligible for termination with a predetermined probability. In some examples, the predetermined probability for each instance of the computing platform <NUM> is the same. For example, the predetermined probability represents a probability that is within the range from <NUM>% to <NUM>%. In certain examples, the predetermined probability is equal to <NUM>% if the runtime of the instance is smaller than a predetermined minimum lifetime. For example, the predetermined minimum lifetime is equal to <NUM> hours. As an example, the predetermined minimum lifetime is equal to <NUM> hours. In one example, the predetermined minimum lifetime is equal to <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, or <NUM> hours. For examples, the predetermined minimum lifetime represents a particular time period that is within a range from <NUM> hours to <NUM> hours. In some examples, the predetermined minimum lifetime for each instance of the computing platform is the same. In certain examples, the predetermined minimum lifetime is smaller than the predetermined maximum lifetime.

In certain embodiments, the predetermined probability increases from <NUM>% at the predetermined minimum lifetime to about <NUM>% at a predetermined natural lifetime. In some examples, the predetermined probability is equal to <NUM>% at the predetermined natural lifetime. As an example, a natural lifetime of an instance represents a period of time that starts when the instance is launched and ends when the instance is expected to naturally run to completion. For example, the predetermined natural lifetime is equal to <NUM> hours. As an example, the predetermined natural lifetime is equal to <NUM> hours. In one example, the predetermined natural lifetime is equal to <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, or <NUM> hours. For examples, the predetermined natural lifetime represents a particular time period that is within a range from <NUM> hours to <NUM> hours. In some examples, the predetermined natural lifetime for each instance of the computing platform is the same. In certain examples, the predetermined natural lifetime is smaller than the predetermined maximum lifetime. In other examples, the predetermined natural lifetime is equal to or larger than the predetermined minimum lifetime. In yet other examples, the predetermined natural lifetime and the predetermined maximum lifetime are the same.

According to some embodiments, the predetermined probability is equal to about <NUM>% if the runtime of the instance is larger than the predetermined natural lifetime. In some examples, the predetermined probability is equal to <NUM>% if the runtime of the instance is larger than the predetermined natural lifetime. In certain examples, the predetermined natural lifetime is different for each instance of the computing platform <NUM>. For example, the predetermined natural lifetimes for all instances of the computing platform <NUM> are different and fall within in a <NUM>-minute range of a <NUM>-hour lifetime. In some examples, each instance <NUM><NUM>-m, <NUM><NUM>-n of the computing platform <NUM> is associated with a predetermined minimum lifetime, a predetermined natural lifetime, and a predetermined maximum lifetime. In other examples, the terminator <NUM> is configured to identify all instances <NUM><NUM>-m, <NUM><NUM>-n of the computing platform <NUM> as eligible for termination if the runtime of each instance <NUM><NUM>-m, <NUM><NUM>-n exceeds the predetermined natural lifetime of the instance.

In some embodiments, the terminator <NUM> is configured to identify an instance of an instance group as ineligible for termination if the instance is associated with a "pause" label. For example, a user of the computing platform <NUM> manually labels the instance "pause" through a console of the computing platform <NUM>. In some examples, the terminator <NUM> is configured to identify an instance as eligible for termination only if the instance is not associated with the "pause" label. In certain examples, all "pause"-labeled instances are ineligible for termination until the label is removed.

In embodiments, the terminator <NUM> is configured to terminate an instance in response to determining that the instance is eligible for termination. In some examples, the terminator <NUM> is configured to identify the termination-eligible instance as unschedulable. For example, the scheduler <NUM> is configured to not schedule pods on any instances identified as unschedulable. In certain examples, the terminator <NUM> is configured to identify an instance of an instance group as ineligible for termination only for one zone of a plurality of zones associated with the instance group. For example, each instance group <NUM><NUM>-m, <NUM><NUM>-n of the computing platform <NUM> is associated with three zones.

<FIG> is a simplified diagram showing the computing platform <NUM> as part of the system <NUM> for terminating instances as shown in <FIG> according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. In some examples, the terminator <NUM> is configured to detach the termination-eligible instance <NUM> from the instance group <NUM><NUM> to create the detached instance <NUM>. For example, detaching the termination-eligible instance <NUM> from the instance group <NUM><NUM> allows a new instance to be associated with the instance group <NUM><NUM>. The terminator <NUM> is configured to wait for the new instance to be associated with the instance group <NUM><NUM>. For example, the terminator <NUM> is configured to wait for the new instance to be associated with the instance group <NUM><NUM> prior to the detached instance <NUM> being terminated. As an example, waiting for the new instance to be associated with the instance group <NUM><NUM> prior to the detached instance <NUM> being terminated allows the instance group <NUM><NUM> to continue operating at a constant capacity. In another example, waiting for the new instance to be associated with the instance group <NUM><NUM> prior to the detached instance <NUM> being terminated allows the instance group <NUM><NUM> to continue operating at close to full capacity. In other examples, the terminator <NUM> is configured to send the detached instance <NUM> to the termination dispatcher <NUM>.

In some embodiments, the termination dispatcher <NUM> is configured to terminate the detached instance <NUM>. For example, the termination dispatcher <NUM> is configured to maintain a queue of instances to be terminated. As an example, the termination dispatcher <NUM> is configured to receive the first instance from the queue and terminate the received instance. In one example, the detached instance <NUM> is the first instance received from the queue to be terminated by the termination dispatcher <NUM>. In some examples, the termination dispatcher <NUM> is configured to immediately terminate the detached instance <NUM> if the runtime of the detached instance <NUM> is equal to or larger than the predetermined maximum lifetime. For example, the predetermined maximum lifetime is equal to <NUM> hours. As an example, the predetermined maximum lifetime is equal to <NUM> hours. In one example, the predetermined maximum lifetime is equal to <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, <NUM> hours, or <NUM> hours. For examples, the predetermined maximum lifetime represents a particular time period that is within a range from <NUM> hours to <NUM> hours. In some examples, the predetermined maximum lifetime for each instance of the computing platform <NUM> is the same. In certain examples, the termination dispatcher <NUM> is configured to terminate the detached instance <NUM> based on a set of predetermined termination rules to allow flexibility as to whether to terminate the detached instance <NUM>.

In embodiments, the termination dispatcher <NUM> is configured to evict each pod associated with the detached instance <NUM> prior to terminating the detached instance <NUM>. In some examples, the evicting a pod by the termination dispatcher <NUM> includes gracefully evicting the pod from the instance associated with the pod. For example, the termination dispatcher <NUM> is configured to not immediately kill each container of the pods associated with the detached instance <NUM>. In one example, gracefully evicting the pod prevents the work associated with the pod to be rescheduled by the scheduler <NUM>. As an example, gracefully evicting a pod by the termination dispatcher <NUM> includes the termination dispatcher <NUM> starting a predetermined grace period and allowing the containers of the pod to run to completion and perform cleanup functions during the predetermined grace period. In one example, the termination dispatcher <NUM> is configured to kill the containers of the pod if the predetermined grace period of the pod is expired.

According to some embodiments, the evicting a pod by the termination dispatcher <NUM> includes respecting a predetermined health condition of the one or more services provided by the pod. For example, the predetermined health condition of a service includes a predetermined maximum number of disruptions related to the service. In one example, the disruptions include voluntary failures and/or voluntary disruptions. In another example, the disruptions include simultaneous failures and/or simultaneous disruptions. In certain examples, the respecting the predetermined health condition of a service includes limiting a number of failures and/or disruptions related to the service to a value that is smaller than the predetermined maximum number of disruptions. In one example, the termination dispatcher <NUM> is configured to evict a pod associated with the detached instance <NUM> if the pod is non-deferring. For example, a pod running and performing work on an instance represents a deferring pod. In another example, the termination dispatcher <NUM> is configured to evict a pod associated with the detached instance <NUM> if evicting the pod does not result in one or more services provided by the evicted pod losing quorum. For example, a pod loses quorum if the number of running replicas of the pod's quorum-based containers and/or quorum-based applications decreases below a value needed for a quorum. In yet another example, the termination dispatcher <NUM> is configured to evict a pod associated with the detached instance <NUM> if evicting the pod does not result in a number of running replicas of a pod's load-serving container or application decreasing below a predetermined percentage of the total load related to the load-serving container or application.

According to certain embodiments, the termination dispatcher <NUM> is configured to terminate the detached instance <NUM> if each pod associated with the detached instance <NUM> is evicted. In some examples, the termination dispatcher <NUM> is configured to immediately terminate the detached instance <NUM> if the runtime of the detached instance <NUM> is equal to or larger than the predetermined maximum lifetime without first evicting each pod associated with the detached instance <NUM>. In certain examples, the termination dispatcher <NUM> is configured to not terminate the detached instance <NUM> if the detached instance <NUM> includes a deferring pod, or if terminating the detached instance <NUM> results in one or more services provided by the pods associated with the detached instance <NUM> losing quorum. In certain examples, the termination dispatcher <NUM> is configured to not terminate the detached instance <NUM> if one or more pods associated with the detached instance <NUM> are not evicted. For example, the termination dispatcher <NUM> is configured to send the detached instance <NUM> to the end of the queue of instances to be terminated so that the pods still associated with the detached instance <NUM> are evicted at a later time.

In some embodiments, the termination dispatcher <NUM> is configured to, in response to satisfying one or more predetermined termination conditions, terminate instances associated with an instance group. In some examples, the satisfying one or more predetermined termination conditions includes terminating the instances on a per instance group basis, in parallel for each instance group <NUM><NUM>-N of the computing platform <NUM>, and/or asynchronously for each instance group <NUM><NUM>-N of the computing platform <NUM>. In certain examples, the satisfying one or more predetermined termination conditions includes terminating one instance associated with one instance group at a time. In other examples, the satisfying one or more predetermined termination conditions includes terminating a number of instances associated with the instance group at the same time with the number not exceeding a predetermined termination maximum. In yet other examples, the satisfying one or more predetermined termination conditions includes terminating related instances that are associated with different instance groups.

In certain embodiments, the terminator <NUM> is configured to monitor one or more termination characteristics. In some examples, the monitored termination characteristics include the termination eligibility of each instance and reasons for each instance being identified as termination eligible or termination ineligible. Other examples of monitored termination characteristics include the time of each terminated instance from when the instance was identified as eligible for termination until termination of the instance and the time for individual stages of the termination process for each instance. Additional examples of monitored termination characteristics include errors encountered when determining termination eligibility of an instance, failures to evict pods, eviction times exceeding a particular threshold, failures to detach an instance, failures to receive a new instance replacing a detached instance, replacement times exceeding a particular threshold, and/or instances that live beyond their predetermined natural lifetime.

<FIG> is a simplified diagram showing the computing platform <NUM> as part of the system <NUM> for autoscaling instance groups as shown in <FIG> according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. Referring to <FIG>, in some examples, the autoscaler <NUM> is configured to independently autoscale each instance group <NUM><NUM>-N of the computing platform <NUM>. In certain examples, the autoscaler <NUM> is configured to autoscale each instance group <NUM><NUM>-N of the computing platform <NUM> on a per instance group basis, in parallel for each instance group <NUM><NUM>-N of the computing platform <NUM>, and/or asynchronously for each instance group <NUM><NUM>-N of the computing platform <NUM>. Referring to <FIG>, in other examples, the autoscaling of the instance group <NUM><NUM> by the autoscaler <NUM> includes scaling up or scaling down the instance group <NUM><NUM>. In yet other examples, the autoscaler <NUM> is configured to independently scale up or scale down the instance group <NUM><NUM> of the computing platform <NUM>.

In some embodiments, the autoscaler <NUM> is configured to allow for one or more configuration options including: for each instance group, instance group name to resource channel name mapping that acts as a white list for which the instance groups can be scaled up and/or scaled down; global defaults (which can be overridden on a per instance group basis); and, optional, per instance group overrides for each global default. For example, the global defaults include a predetermined scale-up threshold as a percentage of allocatable units (resources provided with the default instance type): CPU equal to a sum of resource CPU requests divided by instance's allocatable CPU; and MEM equal to a sum of resource memory requests divided by instance's allocatable memory. As an example, the global defaults include a predetermined scale-down threshold as a percentage of allocatable units (resources provided with the default instance type): CPU equal to a sum of resource CPU requests divided by instance's allocatable CPU; and MEM equal to a sum of resource memory requests divided by instance's allocatable memory. In one example, the global defaults include a maximum pending threshold (duration) that represents a predetermined maximum time, which the oldest demand resource can be kept waiting for before scaling up, which is independent of the predetermined scale-up threshold and the predetermined scale-down threshold, and which ensures that a single demand resource does not wait for too long if there are no more incoming jobs. In another example, the global defaults include a scale-down cool-off timer threshold (duration) that represents a predetermined minimum time to wait between increasing the capacity for an instance group and evaluating the instance group for scaling down.

In certain embodiments, the autoscaler <NUM> is configured to scale up the instance group <NUM><NUM> of the computing platform <NUM>. In some examples, the instance group <NUM><NUM> is associated with a desired instance number. For example, the desired instance number is equal to a value based at least in part on the minimum size of resources and/or the maximum size of resources assigned to the instance group <NUM><NUM>. In one example, the desired instance number is equal to an actual number of instances <NUM><NUM>-m associated with the instance group <NUM><NUM>. In certain examples, the autoscaler <NUM> is configured to receive a request from the scheduler <NUM> to schedule one or more schedulable pods on instances associated with the instance group <NUM><NUM>. In one example, the one or more schedulable pods include all the work to be scheduled on the computing platform <NUM> at a particular time. In other examples, the autoscaler <NUM> is configured to, in response to receiving the request from the scheduler <NUM> to schedule the one or more schedulable pods on instances associated with the instance group <NUM><NUM>, determine a sum equal to demanded resources for the one or more schedulable pods plus scheduled resources of the instance group <NUM><NUM>. For example, the demanded resources include resources required by the one or more schedulable pods to be scheduled on instances associated with instance group <NUM><NUM>. As an example, the scheduled resources of the instance group <NUM><NUM> are equal to a sum of all resources allocated to one or more pods associated with each instance <NUM><NUM>-m of the instance group <NUM><NUM>. In one example, the scheduled resources of the instance <NUM><NUM> are equal to a sum of all resources allocated to the pods <NUM><NUM>-<NUM>.

According to some embodiments, the autoscaler <NUM> is configured to determine a number of new instances associated with the instance group <NUM><NUM> based at least in part on the sum equal to the demanded resources for the one or more schedulable pods plus the scheduled resources of the instance group <NUM><NUM>. In some examples, the autoscaler <NUM> is configured to determine the number of new instances associated with the instance group <NUM><NUM> by bin packing the one or more schedulable pods into the instances <NUM><NUM>-m of the instance group <NUM><NUM>. For example, the autoscaler <NUM> is configured to increase the number of new instances if the autoscaler <NUM> is unable to schedule the one or more schedulable pods on the existing instances <NUM><NUM>-m by bin packing the one or more schedulable pods into the existing instances <NUM><NUM>-m. In certain examples, the autoscaler <NUM> is configured to not increase the number of new instances if the autoscaler <NUM> is able to schedule the one or more schedulable pods on instances of the instance group <NUM><NUM> identified as unschedulable. For example, the autoscaler <NUM> is configured to preferably schedule the one or more schedulable pods on younger instances of the instance group <NUM><NUM> identified as unschedulable. As an example, an instance is younger than another instance if the runtime of the instance is shorter than the runtime of the other instance. In certain examples, the number of new instances associated with the instance group <NUM><NUM> determined by the autoscaler <NUM> changes based on a type of the demanded resources for the one or more schedulable pods. Examples of resource types include CPU resources or memory resources. In other examples, the autoscaler <NUM> is configured to determine the number of new instances being equal to the largest number of new instances determined based on two or more types of the demanded resources for the one or more schedulable pods. For example, if, by bin picking, the autoscaler <NUM> determines two different numbers of new instances for CPU resources and memory resources, respectively, the autoscaler <NUM> determines the number of new instances being equal to the larger for the two numbers to ensure that the one or more schedulable pods fit into the new instances.

According to certain embodiments, the autoscaler <NUM> is configured to evaluate an average utilization percentage of the instance group <NUM><NUM>. In some examples, the average utilization percentage of the instance group <NUM><NUM> is equal to the sum equal to the demanded resources for the one or more schedulable pods plus the scheduled resources of the instance group <NUM><NUM> divided by a sum equal to allocatable resources of the instance group <NUM><NUM> plus allocatable resources of the new instances. For example, the allocatable resources of an instance represents a predetermined maximum of resources associated with the instance. As an example, the allocatable resources of the instance group <NUM><NUM> is equal to a sum of the allocatable resources of each instance <NUM><NUM>-m associated with instance group <NUM><NUM>. In certain examples, the average utilization percentage of the instance group <NUM><NUM> is equal to an average of the utilization percentage for each instance <NUM><NUM>-m associated with instance group <NUM><NUM>. For example, the utilization percentage of an instance is equal to the scheduled resources of the instance divided by the allocatable resources of the instance. In other examples, the autoscaler <NUM> is configured to determine the average utilization percentage of the instance group <NUM><NUM> based on the type of demanded resources for the one or more schedulable pods. For example, the average utilization percentage changes based on the type of demanded resources.

In some embodiments, the autoscaler <NUM> is configured to increase the desired instance number of the instance group <NUM><NUM> by the determined number of new instances if the average utilization is larger than a predetermined scale-up threshold. In some examples, the autoscaler <NUM> is configured to increase the desired instance number of the instance group <NUM><NUM> by the determined number of new instances if the average utilization for at least one type of demanded resources is larger than the predetermined scale-up threshold of the at least one type of demanded resources. For example, the autoscaler <NUM> is configured to increase the desired instance number by the determined number of new instances if the average utilization for either CPU resources or memory resources exceeds the corresponding predetermined scale-up threshold, respectively. In certain examples, the autoscaler <NUM> is configured to change the desired instance number of the instance group <NUM><NUM> to the predetermined maximum instance number associated with the instance group if the desired instance number exceeds the predetermined maximum instance number.

In certain embodiments, the autoscaler <NUM> is configured to increase the desired instance number of the instance group <NUM><NUM> by the determined number of new instances if a duration for which the request to schedule the one or more schedulable pods is pending exceeds a maximum pending threshold, and if the request is the oldest request received by the autoscaler <NUM>. For example, increasing the desired instance number if the duration for which the oldest request is pending exceeds a maximum threshold allows scheduling the one or more schedulable pods associated the request if no other request have been received by the autoscaler <NUM>. In certain examples, the autoscaler <NUM> is configured to increase the desired instance number of the instance group <NUM><NUM> by the determined number of new instances if a duration for which the request to schedule the one or more schedulable pods is pending exceeds a maximum pending threshold, and if the average utilization is not larger than a predetermined scale-up threshold.

According to some embodiments, the autoscaler <NUM> is configured to scale up the instance group <NUM><NUM> by incrementing the desired instance number and then waiting for the instance to become available. In some examples, the autoscaler <NUM> is configured to perform health checks of an instance group that indicate failures like the instance group reaching a predetermined maximum instance number, a zone associated with the instance group being out of capacity, and/or account wide instance type limits.

According to certain embodiments, the autoscaler <NUM> is configured to scale down the instance group <NUM><NUM> of the computing platform <NUM>. In some examples, the autoscaler <NUM> is configured to determine whether a utilization percentage of an instance associated with an instance group is smaller than a predetermined scale-down threshold. For example, the utilization percentage of an instance is equal to the scheduled resources of the instance divided by the allocatable resources of the instance. In certain examples, the autoscaler <NUM> is configured to, in response to determining that the utilization percentage of the instance is smaller than the predetermined scale-down threshold, identify the instance as unschedulable. In other examples, the autoscaler <NUM> is configured to wait for each running pod associated with the identified instance to run to completion. In yet other examples, the autoscaler <NUM> is configured to, in response to each running pod associated with the identified instance running to completion, detach the identified instance from the instance group <NUM><NUM>. In some examples, the autoscaler <NUM> is configured to, in response to detaching the identified instance from the instance group <NUM><NUM>, decrease the desired instance number associated with the instance group <NUM><NUM> by one. In certain examples, the autoscaler <NUM> is configured to identify the detached instance as eligible for termination and send the detached instance to the termination dispatcher <NUM> for termination.

In some embodiments, the autoscaler <NUM> is configured to evaluate scaling down decisions within the context of a single instance group. For example, all instance groups that the autoscaler <NUM> is configured to manage are evaluated in parallel and asynchronously by the autoscaler <NUM>. In some examples, a decision of the autoscaler <NUM> to scale down is triggered by the following. For example, a cool-down timer is used to allow time for new jobs to be scheduled on an existing capacity before being scaled down. As an example, the duration of the timer is defined via the configuration of the autoscaler <NUM> and defaults to <NUM> seconds. In one example, the cool-down timer must expire prior to the autoscaler's <NUM> evaluation of excess capacity to occur. In certain examples, any time the autoscaler <NUM> determines to bring up new instances as part of scaling up an instance group, the cool-down timer is reset for the corresponding instance group. In other examples, the autoscaler <NUM> is configured to not scale down if there are existing unfulfilled demand resources for the instance group. In some examples, once the cool-down time expires, the autoscaler <NUM> is configured to evaluate all nodes within the instance group for eligibility to be scaled down, using the following criteria: (<NUM>) instances are sorted based on free allocatable capacity, from the largest free allocatable capacity to least free allocatable capacity, for both memory and CPU (e.g., "free allocatable capacity" is determined by the autoscaler <NUM> taking the instance's allocatable resources for memory or CPU and subtracting a sum of container memory resource requests or container CPU resources requests, respectively); and (<NUM>) instances are filtered to only those in which the utilization of both memory and CPU are under the predetermined scale-down threshold.

In certain embodiments, the autoscaler <NUM> is configured to mark the instances running on the filtered set of instances as "unschedulable" in batches of configurable size(<NUM>. len(instance group)). In some examples, the batch size allows to tune the aggressiveness of scaling down the instance group. In certain examples, the autoscaler <NUM> is configured to mark one instance at a time as "unschedulable". In other examples, the autoscaler <NUM> is configured to monitor the instances that have been marked "unschedulable" as a background process and wait for all the running pods on each instance to exit. For example, the autoscaler <NUM> is configured to, once all the non-control plane pods on an instance have exited, to detach and decrement the desired instance number of the corresponding instance group. In certain examples, the terminator <NUM> is configured to actually decommission and terminate the instance. For example, the terminator <NUM> is configured to not terminate instances marked as "unschedulable" and terminate detached instances.

In one example, the computing platform includes five instances with each instance having a maximum capacity of <NUM> resource units (RU). In this example, the predetermined scale-down threshold is equal to <NUM>%, instance <NUM> is running <NUM> RU, instance <NUM> is running <NUM> RU, instance <NUM> is running <NUM> RU, and instance <NUM> is running <NUM> RU. Since instance <NUM> and instance <NUM> in this example are below the scale down utilization thresholds, the autoscaler <NUM> is configured to mark these instances as "unschedulable" and wait for the pods running on these instances to finish. In this example, if the pod on instance <NUM> exits at this point, the autoscaler <NUM> is configured to notice the pod existing, detach the instance from the instance group, and decrement the desired instance number of the instance group size. In this example, the terminator <NUM> is configured to terminate the detached instance, and the autoscaler <NUM> is configured to, if a new demand resource has been created that requires 2x3RU and since instance <NUM> is still marked as "unschedulable", use instance <NUM> to accommodate the new demand. In another example, since the entire demand can be accommodated on instance <NUM> (which is only been using <NUM> RU), the autoscaler <NUM> is configured to simply mark instance <NUM> as "schedulable" and mark the demand as "fulfilled.

In another examples, if the autoscaler <NUM> increases the capacity of an instance group in response to a demand object, but the new capacity is used for another job, the autoscaler <NUM> is configured to mark the demand resource as "fulfilled" and the scheduler <NUM> is configured to, on noticing that despite the demand being "fulfilled" and being unable to schedule the job, reset the demand to the empty status so that the autoscaler <NUM> reconsiders the demand.

In yet another example, the scheduler <NUM> creates a first demand for 5x1x1 RU. In this example, the autoscaler <NUM> acknowledges the demand and increases capacity by 1x16x16 RU. In this example, between when instance group's desired instance number is increased by the autoscaler <NUM> and before the corresponding new instance comes online, the scheduler <NUM> creates a new second demand for 5x1x1 RU for another job. In this example, the autoscaler's <NUM> bin packing indicates that no additional bins are required to schedule the second demand, and the autoscaler <NUM> is configured to mark the status of the second demand as "fulfilled" and wait for the scheduler <NUM> to schedule the job and remove the second demand.

According to some embodiments, a decision of the autoscaler <NUM> to scale down is triggered by the following. For example, a cool-down timer is used allow for time for new jobs to be scheduled on the existing capacity before being scaled down. In one example, the duration of the timer is defined via the configuration of the autoscaler <NUM>. In some examples, the cool-down timer expires prior to the autoscaler <NUM> evaluating excess capacity. For example, any time a new demand resource is created, the cool-down timer is reset for the corresponding instance group. As an example, the autoscaler <NUM> is configured to not scale down an instance group if there are existing demand resources for the instance group. In certain examples, the autoscaler <NUM> is configured, once the cool-down time expires, to evaluate all instances within the instance group for eligibility to be scaled down, using the following criteria: (<NUM>) instances are sorted based on free allocatable capacity, from the largest free allocatable capacity to least free allocatable capacity, for both memory and CPU (e.g., "free allocatable capacity" is determined by the autoscaler <NUM> taking the instance's allocatable resources for memory or CPU and subtracting a sum of container memory resource requests or container CPU resources requests, respectively); and (<NUM>) instances are filtered to only those in which the utilization of both memory and CPU are under the predetermined scale-down threshold.

According to certain embodiments, the autoscaler <NUM> is configured to, of the eligible instances to be scaled down, select one instance at a time based on the following: (<NUM>) the sum of the priority field of all pods currently scheduled on an instance is computed to attempt to minimize the impact to higher priority pods running across instance; (<NUM>) instances are sorted based on the sum of the priority, smallest to largest; and (<NUM>) ties are broken by using the creation time of the instance, preferring an older instance over a younger instance. In some examples, the autoscaler <NUM> is configured to scale down one instance per instance group at a time, until no remaining instances that meet the criteria, or the cool-down timer is reset. In certain examples, the autoscaler <NUM> is configured to scale-down instances of an instance group by: (<NUM>) marking the selected instance as unschedulable; (<NUM>) detach the selected instance and decrement the desired instance number of the instance group in a one atomic operation; (<NUM>) relying on the terminator <NUM> to actually decommission and terminate the detached instance by draining the pods from the instance and eventually forcefully terminate the instance. In other examples, the autoscaler <NUM> is configured to not continue to the next eligible instance to scale-down, until all pods have been evicted off the prior instance and no unscheduled pods are assigned to the instance group.

In some embodiments, the autoscaler <NUM> is configured to, once the cool-down time expires, to evaluate all instance within an instance group for eligibility to be scaled down, using the criteria that instances are filtered to only those instances in which the utilization of both CPU and memory are under the predetermined scale-down threshold. In some examples, the autoscaler <NUM> is configured to further filter out any instances with deferring pods. For examples, the autoscaler <NUM> is configured to attempt and move capacity to deferring instances from other instance with the deferring instances including pods that are not to be killed. In certain examples, the autoscaler <NUM> is configured to order the filtered instances based on the following: (<NUM>) the sum of the priority field of all pods currently scheduled on an instances is computed, lower priority first, to attempt to minimize the impact to higher priority pods running across instances; and (<NUM>) ties are broken by using the creation time of the instance, preferring an older instance over a younger instance. In other examples, the autoscaler <NUM> is configured to, starting from the first instance in the ordered list of instances, to bin pack pods of the first instance onto other instances of the computing platform <NUM>. For example, an instance is considered scale-down-able by the autoscaler <NUM>, if all pods of the instance are bin packable onto other instance of the computing platform <NUM>. In some examples, the autoscaler <NUM> is configured to continue this process until there are no more instances left in the ordered list or until no more instances can be removed. For example, some instances might still be below the predetermined utilization threshold targets after this process is completed due to their workload not being schedulable on other instances of the computing platform <NUM>. In yet another example, it is likely that the instances towards the end of the ordered list, i.e., the instances with higher priorities, are the ones that most of the workload is shifted to. In this example, the autoscaler <NUM> is configured to not wait for an instance to actually terminate before moving on in the ordered list of instances eligible for scale down.

In certain embodiments, the autoscaler <NUM> is configured to monitor the following metrics to track its efficiency and impact: (<NUM>) percentage of available CPU or memory allocated by the computing platform <NUM>; (<NUM>) the time from an instance group "scale up" call to an instance being schedulable; (<NUM>) the time from an instance group "scale down" call to an instance being terminated; (<NUM>) the number of pods being evicted if an instance group is scaled down; (<NUM>) the time that an demand exist before being filled; (<NUM>) the time that excess capacity exist before being removed; (<NUM>) the length of the demand queue, e.g., sum(len(demand units)); and the size of the demand queue in terms of CPU, e.g., sum(CPU in each demand unit), and/or in terms of memory, e.g., sum(memory in each demand unit).

<FIG> is a simplified diagram showing a method for terminating an instance associated with an instance group of a computing platform according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. The method <NUM> includes processes <NUM>-<NUM> that are performed using one or more processors. Although the above has been shown using a selected group of processes for the method, there can be many alternatives, modifications, and variations. For example, some of the processes may be expanded and/or combined. Other processes may be inserted to those noted above. Depending upon the embodiment, the sequence of processes may be interchanged with others replaced.

In some embodiments, some or all processes (e.g., steps) of the method <NUM> are performed by the system <NUM>. In certain examples, some or all processes (e.g., steps) of the method <NUM> are performed by a computer and/or a processor directed by a code. For example, a computer includes a server computer and/or a client computer (e.g., a personal computer). In some examples, some or all processes (e.g., steps) of the method <NUM> are performed according to instructions included by a non-transitory computer-readable medium (e.g., in a computer program product, such as a computer-readable flash drive). For example, a non-transitory computer-readable medium is readable by a computer including a server computer and/or a client computer (e.g., a personal computer, and/or a server rack). As an example, instructions included by a non-transitory computer-readable medium are executed by a processor including a processor of a server computer and/or a processor of a client computer (e.g., a personal computer, and/or server rack).

In embodiments, at the process <NUM>, whether an instance of an instance group is identified as eligible for termination is determined. At the process <NUM>, in response to determining that the instance of the instance group is identified as eligible for termination, the eligible instance is terminated. At the process <NUM>, in response to a runtime of the eligible instance being equal to or larger than a predetermined maximum lifetime, the eligible instance is terminated. At the process <NUM>, in response to the runtime being smaller than the predetermined maximum lifetime, the eligible instance from the instance group is detached to allow a new instance to be associated with the instance group. At the process <NUM>, in response to the eligible instance being detached from the instance group, the new instance to be associated with the instance group is waited for. At the process <NUM>, in response to the eligible instance being detached from the instance group, each pod associated with the detached instance is evicted.

<FIG> is a simplified diagram showing a method for scaling up an instance group of a computing platform according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. The method <NUM> includes processes <NUM>-<NUM> that are performed using one or more processors. Although the above has been shown using a selected group of processes for the method, there can be many alternatives, modifications, and variations. For example, some of the processes may be expanded and/or combined. Other processes may be inserted to those noted above. Depending upon the embodiment, the sequence of processes may be interchanged with others replaced.

In some embodiments, at the process <NUM>, a request to schedule one or more schedulable pods on instances associated with an instance group of a computing platform is received. At the process <NUM>, a first sum equal to demanded resources for the one or more schedulable pods plus scheduled resources of the instance group is determined. At the process <NUM>, a number of new instances associated with the instance group based at least in part on the first sum is determined. At the process <NUM>, an average utilization percentage of the instance group is evaluated. At the process <NUM>, in response to the average utilization percentage being larger than a predetermined scale-up threshold, a desired instance number associated with the instance group is increased by the determined number of new instances.

<FIG> is a simplified diagram showing a method for scaling down an instance group of a computing platform according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. The method <NUM> includes processes <NUM>-<NUM> that are performed using one or more processors. Although the above has been shown using a selected group of processes for the method, there can be many alternatives, modifications, and variations. For example, some of the processes may be expanded and/or combined. Other processes may be inserted to those noted above. Depending upon the embodiment, the sequence of processes may be interchanged with others replaced.

In some embodiments, at the process <NUM>, whether a utilization percentage of an instance associated with the instance group is smaller than a predetermined scale-down threshold is determined. At the process <NUM>, in response to determining that the utilization percentage of the instance is smaller than the predetermined scale-down threshold, each running pod associated with the instance to run to completion is waited for. At the process <NUM>, in response to each running pod associated with the instance running to completion, the instance from the instance group is detached. At the process <NUM>, in response to detaching the instance from the instance group, a desired instance number associated with the instance group is decreased by one.

<FIG> is a simplified diagram showing a computing system for implementing a system for terminating instances and/or autoscaling instance groups of a computing platform according to one embodiment of the present invention. This diagram is merely an example, which should not unduly limit the scope of the claims. One of ordinary skill in the art would recognize many variations, alternatives, and modifications. The computing system <NUM> includes a bus <NUM> or other communication mechanism for communicating information, a processor <NUM>, a display <NUM>, a cursor control component <NUM>, an input device <NUM>, a main memory <NUM>, a read only memory (ROM) <NUM>, a storage unit <NUM>, and a network interface <NUM>. In some embodiments, some or all processes (e.g., steps) of the method <NUM>, the method <NUM>, and/or the method <NUM> are performed by the computing system <NUM>. In some examples, the bus <NUM> is coupled to the processor <NUM>, the display <NUM>, the cursor control component <NUM>, the input device <NUM>, the main memory <NUM>, the read only memory (ROM) <NUM>, the storage unit <NUM>, and/or the network interface <NUM>. In certain examples, the network interface is coupled to a network <NUM>. For example, the processor <NUM> includes one or more general purpose microprocessors. In some examples, the main memory <NUM> (e.g., random access memory (RAM), cache and/or other dynamic storage devices) is configured to store information and instructions to be executed by the processor <NUM>. In certain examples, the main memory <NUM> is configured to store temporary variables or other intermediate information during execution of instructions to be executed by processor <NUM>. For examples, the instructions, when stored in the storage unit <NUM> accessible to processor <NUM>, render the computing system <NUM> into a special-purpose machine that is customized to perform the operations specified in the instructions. In some examples, the ROM <NUM> is configured to store static information and instructions for the processor <NUM>. In certain examples, the storage unit <NUM> (e.g., a magnetic disk, optical disk, or flash drive) is configured to store information and instructions.

In some embodiments, the display <NUM> (e.g., a cathode ray tube (CRT), an LCD display, or a touch screen) is configured to display information to a user of the computing system <NUM>. In some examples, the input device <NUM> (e.g., alphanumeric and other keys) is configured to communicate information and commands to the processor <NUM>. For example, the cursor control <NUM> (e.g., a mouse, a trackball, or cursor direction keys) is configured to communicate additional information and commands (e.g., to control cursor movements on the display <NUM>) to the processor <NUM>.

According to embodiments, a method for terminating an instance associated with an instance group of a computing platform includes determining whether an instance of an instance group is identified as eligible for termination. The method further includes, in response to determining that the instance of the instance group is identified as eligible for termination, terminating the eligible instance. The terminating the eligible instance includes, in response to a runtime of the eligible instance being equal to or larger than a predetermined maximum lifetime, terminating the eligible instance. The terminating the eligible instance further includes, in response to the runtime being smaller than the predetermined maximum lifetime, detaching the eligible instance from the instance group to allow a new instance to be associated with the instance group, and in response to the eligible instance being detached from the instance group: waiting for the new instance to be associated with the instance group, and evicting each pod associated with the detached instance. The method is performed using one or more processors. For example, the method is implemented according to at least <FIG>, <FIG>, and/or <FIG>.

The terminating the eligible instance further includes in response to evicting each pod associated with the detached instance, terminating the detached instance. The terminating the eligible instance further includes, in response to the runtime being smaller than the predetermined maximum lifetime, identifying the eligible instance as unschedulable to prevent pods being scheduled on the eligible instance. In some examples, the evicting each pod associated with the detached instance includes: respecting a predetermined health condition of one or more services associated with each pod, and gracefully evicting each pod from the detached instance.

In certain examples, the method further includes identifying the instance as eligible for termination. In some examples, the identifying the instance as eligible for termination includes identifying the instance as eligible for termination if the runtime of the instance is equal to or larger than the predetermined maximum lifetime. In certain examples, the identifying the instance as eligible for termination includes identifying the instance as eligible for termination if the instance is not associated with an instance group of the computing platform.

In some examples, the identifying the instance as eligible for termination includes identifying the instance as eligible for termination if the runtime of the instance is larger than a predetermined minimum lifetime. In certain examples, the identifying the instance as eligible for termination further includes identifying the instance as eligible for termination with a predetermined probability. The predetermined probability is equal to <NUM>% if the runtime of the instance is smaller than the predetermined minimum lifetime. The predetermined probability increases from <NUM>% at the predetermined minimum lifetime to about <NUM>% at a predetermined natural lifetime. The predetermined probability is equal to about <NUM>% if the runtime of the instance is larger than the predetermined natural lifetime. The predetermined natural lifetime is equal to or larger than the predetermined minimum lifetime. The predetermined natural lifetime is smaller than the predetermined maximum lifetime.

In certain examples, the identifying the instance as eligible for termination further includes identifying the instance as eligible for termination if the computing platform provides a software upgrade for the instance or the instance group associated with the instance. In some examples, the software upgrade is critical or an infrastructure upgrade. In certain examples, the method is performed on a per instance group basis, in parallel for each instance group of the computing platform, or asynchronously for each instance group of the computing platform.

According to certain embodiments, a computer-implemented system for scaling up an instance group of a computing platform includes one or more processors and a memory storing instructions. The instructions, when executed by the one or more processors, cause the system to perform: receiving a request to schedule one or more schedulable pods on instances associated with an instance group of a computing platform, determining a first sum equal to demanded resources for the one or more schedulable pods plus scheduled resources of the instance group, determining a number of new instances associated with the instance group based at least in part on the first sum, evaluating an average utilization percentage of the instance group, and in response to the average utilization percentage being larger than a predetermined scale-up threshold, increasing a desired instance number associated with the instance group by the determined number of new instances. For example, the system is implemented according to at least <FIG>, and/or <FIG>.

In some examples, the instructions, when executed by the one or more processors, cause the system to further perform, in response to the desired instance number exceeding a predetermined maximum instance number associated with the instance group, changing the desired instance number to the predetermined maximum instance number. In certain examples, the average utilization percentage is equal to the first sum divided by a second sum equal to allocatable resources of the instance group plus allocatable resources of the new instances. In some examples, the average utilization percentage is equal to an average of a utilization percentage for each instance associated with instance group.

According to some embodiments, a method for scaling up an instance group of a computing platform. The method includes receiving a request to schedule one or more schedulable pods on instances associated with an instance group of a computing platform, determining a first sum equal to demanded resources for the one or more schedulable pods plus scheduled resources of the instance group, determining a number of new instances associated with the instance group based at least in part on the first sum, evaluating an average utilization percentage of the instance group, and in response to the average utilization percentage being larger than a predetermined scale-up threshold, increasing a desired instance number associated with the instance group by the determined number of new instances. The method is performed using one or more processors. For example, the method is implemented according to at least <FIG>, <FIG>, and/or <FIG>.

In some examples, the method further includes, in response to the desired instance number exceeding a predetermined maximum instance number associated with the instance group, changing the desired instance number to the predetermined maximum instance number. In certain examples, the average utilization percentage is equal to the first sum divided by a second sum equal to allocatable resources of the instance group plus allocatable resources of the new instances. In some examples, the average utilization percentage is equal to an average of a utilization percentage for each instance associated with instance group.

According to certain embodiments, a computer-implemented system for scaling down an instance group of a computing platform includes one or more processors and a memory storing instructions. The instructions, when executed by the one or more processors, cause the system to perform determining whether a utilization percentage of an instance associated with the instance group is smaller than a predetermined scale-down threshold. The instructions, when executed by the one or more processors, cause the system to further perform, in response to determining that the utilization percentage of the instance is smaller than the predetermined scale-down threshold: waiting for each running pod associated with the instance to run to completion, in response to each running pod associated with the instance running to completion, detaching the instance from the instance group, and in response to detaching the instance from the instance group, decreasing by one a desired instance number associated with the instance group. For example, the system is implemented according to at least <FIG>, and/or <FIG>.

In some examples, the instructions, when executed by the one or more processors, cause the system to further perform, in response to determining that the utilization percentage of the instance is smaller than the predetermined scale-down threshold, identifying the instance as unschedulable to prevent pods being scheduled on the instance. In certain examples, the instructions, when executed by the one or more processors, cause the system to further perform, in response to detaching the instance from the instance group, identifying the detached instance as eligible for termination. In some examples, the instructions, when executed by the one or more processors, cause the system to further perform, in response to detaching the instance from the instance group, terminating the detached instance.

According to some embodiments, a method for scaling down an instance group of a computing platform. The method includes determining whether a utilization percentage of an instance associated with the instance group is smaller than a predetermined scale-down threshold. The method further includes, in response to determining that the utilization percentage of the instance is smaller than the predetermined scale-down threshold: waiting for each running pod associated with the instance to run to completion, in response to each running pod associated with the instance running to completion, detaching the instance from the instance group, and in response to detaching the instance from the instance group, decreasing by one a desired instance number associated with the instance group. The method is performed using one or more processors. For example, the method is implemented according to at least <FIG>, <FIG> and/or <FIG>.

In some examples, the method further includes, in response to determining that the utilization percentage of the instance is smaller than the predetermined scale-down threshold, identifying the instance as unschedulable to prevent pods being scheduled on the instance. In certain examples, the method further includes, in response to detaching the instance from the instance group, identifying the detached instance as eligible for termination. In some examples, the method further includes, in response to detaching the instance from the instance group, terminating the detached instance.

For example, some or all components of various embodiments of the present invention each are, individually and/or in combination with at least another component, implemented using one or more software components, one or more hardware components, and/or one or more combinations of software and hardware components. In another example, some or all components of various embodiments of the present invention each are, individually and/or in combination with at least another component, implemented in one or more circuits, such as one or more analog circuits and/or one or more digital circuits.

Additionally, the methods and systems described herein may be implemented on many different types of processing devices by program code comprising program instructions that are executable by the device processing subsystem. The software program instructions may include source code, object code, machine code, or any other stored data that is operable to cause a processing system to perform the methods and operations described herein. Other implementations may also be used, however, such as firmware or even appropriately designed hardware configured to perform the methods and systems described herein.

The systems' and methods' data (e.g., associations, mappings, data input, data output, intermediate data results, final data results, etc.) may be stored and implemented in one or more different types of computer-implemented data stores, such as different types of storage devices and programming constructs (e.g., RAM, ROM, EEPROM, Flash memory, flat files, databases, programming data structures, programming variables, IF-THEN (or similar type) statement constructs, application programming interface, etc.). It is noted that data structures describe formats for use in organizing and storing data in databases, programs, memory, or other computer-readable media for use by a computer program.

The systems and methods may be provided on many different types of computer-readable media including computer storage mechanisms (e.g., CD-ROM, diskette, RAM, flash memory, computer's hard drive, DVD, etc.) that contain instructions (e.g., software) for use in execution by a processor to perform the methods' operations and implement the systems described herein. The computer components, software modules, functions, data stores and data structures described herein may be connected directly or indirectly to each other in order to allow the flow of data needed for their operations. It is also noted that a module or processor includes a unit of code that performs a software operation, and can be implemented for example as a subroutine unit of code, or as a software function unit of code, or as an object (as in an object-oriented paradigm), or as an applet, or in a computer script language, or as another type of computer code. The software components and/or functionality may be located on a single computer or distributed across multiple computers depending upon the situation at hand.

The computing system can include client devices and servers. A client device and server are generally remote from each other and typically interact through a communication network. The relationship of client device and server arises by virtue of computer programs running on the respective computers and having a client device-server relationship to each other.

This specification contains many specifics for particular embodiments. Moreover, although features may be described above as acting in certain combinations, one or more features from a combination can in some cases be removed from the combination, and a combination may, for example, be directed to a subcombination or variation of a subcombination.

Claim 1:
A computer-implemented method for terminating an instance associated with an instance group of a computing platform, the method comprising:
determining (<NUM>) whether an instance (<NUM>), (<NUM>) of an instance group (<NUM>) is identified as eligible for termination; and
in response to determining that the instance of the instance group is identified as eligible for termination, terminating (<NUM>) the eligible instance by:
in response to a runtime of the eligible instance being equal to or larger than a predetermined maximum lifetime, terminating (<NUM>) the eligible instance; and
in response to the runtime being smaller than the predetermined maximum lifetime, detaching (<NUM>) the eligible instance from the instance group such that it is not associated with the instance group but is still running on the computing platform and in response:
preparing a new instance as operational;
associating the new operational instance with the instance group; and
evicting (<NUM>) each pod associated with the detached instance and then terminating the detached instance,
wherein the terminating the eligible instance further includes, in response to the runtime being smaller than the predetermined maximum lifetime, identifying the eligible instance as unschedulable to prevent pods being scheduled on the eligible instance.