Performance-based hardware emulation in an on-demand network code execution system
Dynamically configure virtual machine instances through the on-demand code execution system and virtual machine instance manager, and use the simulation supply system to optimize resource allocation, solving the inefficiency problems caused by limited computing resources and resource overhead in the computing system, and achieving efficient and fast code implement.
Patent Information
- Application Number
- CN201980081324.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-13
- Filing Date
- 2019-12-10
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2039-12-10
AI Technical Summary
Existing computing systems are inefficient when executing code due to limited computing resources and resource overhead, and fail to effectively utilize the functional resources provided by virtual machines, resulting in unused or inefficient use of resources.
Adopt an on-demand code execution system, dynamically create and configure virtual machine instances through the virtual machine instance manager, and use the computing resource pool to allocate optimized resources according to code requirements, including simulated processors and memories, to achieve rapid task execution and provide the system through the simulation Analyze code requirements and optimize resource allocation.
It improves the code execution capability of the computing system, improves resource utilization, achieves fast and real-time task execution, and avoids resource waste and inefficient utilization.
Smart Images

Figure CN113243005B_ABST
Abstract
Description
Background Art
[0001] Computing devices can utilize communication networks to exchange data. Companies and organizations operate computer networks that interconnect many computing devices to support operations or provide services to third parties. Computing systems can be located in a single geographic location or in multiple different geographic locations (e.g., interconnected via a private communication network or a public communication network). Specifically, a managed computing environment or data processing center, generally referred to herein as a "data center," may include many interconnected computing systems to provide computing resources to users of the data center. The data center may be a private data center operated on behalf of an organization or a public data center operated on behalf of the public or for the benefit of the public.
[0002] To facilitate increased utilization of data center resources, virtualization technology allows a single physical computing device to host one or more instances of virtual machines that appear and operate as independent computing devices to users of the data center. Through virtualization, a single physical computing device can dynamically create, maintain, delete, or otherwise manage virtual machines. Users can then request computing resources from the data center, such as a configuration of a single computing device or networked computing devices, and be provisioned with different numbers of virtual machine resources.
[0003] In some scenarios, a user may request a data center to provide computing resources to perform a specific task. The task may correspond to a set of computer executable instructions, which the data center may then execute on behalf of the user. The data center may thus further contribute to increased utilization of data center resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0004] Reference numerals may be repeated throughout the drawings to indicate correspondence between reference elements.The drawings are provided to illustrate the exemplary embodiments described herein and are not intended to limit the scope of the present disclosure.
[0005] Figure 1 is a block diagram depicting an illustrative environment in which an on-demand code execution system can perform tasks corresponding to code that can be submitted by a user of the on-demand code execution system and can determine which computing resources to use to facilitate execution of the submitted code.
[0006] Figure 2 A general architecture of a computing device providing a simulation performance analysis system is described, wherein the simulation performance analysis system is configured to determine a method for facilitating Figure 1 The computing resources to execute tasks on the on-demand code execution system.
[0007] Figure 3 It is depicted towards Figure 1A flowchart of an illustrative interaction of a set of computing resources that can be used to facilitate execution is provided to an on-demand code execution system that submits code corresponding to a task and causes the on-demand code execution system to analyze the code and determine.
[0008] Figure 4 It is a depiction Figure 1 A flowchart of illustrative interactions of an on-demand code execution system for performing the following operations: analyzing performance metrics associated with executing code using a particular set of computing resources; determining whether an alternative set of computing resources is available and would be preferred; and if so, migrating code execution to the alternative set of computing resources.
[0009] Figure 5 is a description of the code that is used to analyze submitted code to determine whether it can be used to advance Figure 1 A flow chart of an illustrative routine for executing code on a set of resources of an on-demand code execution system.
[0010] Figure 6 It is used to analyze Figure 1 A flowchart of an illustrative routine for executing code using a particular set of resources on an on-demand code execution system and migrating the code to an alternate set of resources when needed. DETAILED DESCRIPTION
[0011] In general, aspects of the present disclosure relate to an on-demand code execution system. An on-demand code execution system enables fast execution of code that can be supplied by a user of an on-demand code execution system. More specifically, embodiments of the present disclosure relate to improving the performance of an on-demand code execution system implemented using various computing resources. As described in detail herein, an on-demand code execution system may provide a network accessible service that enables a user to submit or specify a computer executable code to be executed by a virtual machine instance on an on-demand code execution system. Each set of code on an on-demand code execution system may define a "task" and implement a specific functionality corresponding to that task when executed on a virtual machine instance of an on-demand code execution system. Implementing tasks individually on an on-demand code execution system may be referred to as "executing" tasks (or "task execution"). An on-demand code execution system may further enable a user to trigger the execution of a task based on a variety of potential events, such as detecting new data at a network-based storage system, transmitting an application programming interface ("API") call to an on-demand code execution system, or transmitting a hypertext transfer protocol ("HTTP") packet in a special format to an on-demand code execution system. Thus, a user can utilize an on-demand code execution system to execute any specified executable code "on demand" without having to configure or maintain the underlying hardware or infrastructure on which the code is executed. In addition, the on-demand code execution system can be configured to execute tasks in a rapid manner (e.g., under 100 milliseconds [ms]) to achieve "real-time" (e.g., with a delay that is barely perceptible to an end user).
[0012] The on-demand code execution system can instantiate virtual machine instances on demand to perform specified tasks. The virtual machine instance may be equipped with a virtual processor or other computing resources that provide functionality that the user-specified executable code may need during execution. For example, a virtual machine instance may be equipped with a processor that facilitates or accelerates operations often used by neural networks. The processor may implement (for example) a specific instruction set (or an extension of the instruction set) associated with these operations. In some embodiments, the instruction set may also be implemented by the underlying hardware processor of the physical computing device on which the virtual machine instance is instantiated. In other embodiments, the virtual machine instance may emulate a processor that implements a specific instruction set, and the virtual machine instance may be instantiated using a physical processor that does not implement the instruction set. The virtual machine instance can therefore translate instructions implemented by the virtual processor into instructions implemented by the physical processor, with different effects on performance or efficiency.
[0013] The on-demand code execution system can utilize a computing resource pool to execute user-submitted code. The pool may include resources that vary according to functionality, and the demand for resources that implement specific functionality may exceed the available supply of those resources. For example, tasks submitted by several users may require or prefer processors that implement specific instruction sets, but only a limited number of these processors may be available. In some embodiments, excessive demand for resources that implement specific functionality can be met using resources that simulate the functionality. For example, as discussed above, a virtual machine instance of an emulated processor may be instantiated, and the on-demand code execution system may assign user-submitted tasks to physical resources and virtual resources based on factors such as relative performance. For example, a task submitted by a first user may be able to be executed at acceptable performance on an emulated processor, while a task submitted by a second user may be executed very slowly or not at all. The on-demand code execution system can therefore prioritize the allocation of scarce resources based on an assessment of whether the functionality is needed or merely desired to perform a specific task, and can further prioritize based on the relative performance of different tasks so that the tasks that benefit most from the functionality receive the functionality.
[0014] In some embodiments, a virtual machine instance instantiated on a fast physical processor may outperform a virtual or physical computing device using a slower processor, even if the slower processor provides functionality that the faster processor does not provide. For example, an older processor with a particular instruction set may be emulated in a virtual machine instance instantiated on a newer processor that does not have the instruction set, and the performance gain achieved by executing on the newer processor may more than offset the performance overhead associated with the emulated processor or instruction set. It will therefore be appreciated that the on-demand code execution system is not limited to physical processors when determining a recommended set of computing resources, and that virtual emulation of physical processors may provide superior performance.
[0015] Those skilled in the art will appreciate in light of the present disclosure that the embodiments disclosed herein improve the ability of computing systems, such as on-demand code execution systems, to execute code in an efficient manner. In addition, the embodiments disclosed herein address technical problems inherent in computing systems; specifically, the limited nature of computing resources used to execute code, resource overhead associated with provisioning virtual machines to facilitate code execution, and inefficiencies caused by provisioning unused functionality (or not provisioning functionality that would be utilized if available). These technical problems are addressed by the various technical solutions described herein, including provisioning an execution environment based on the functionality required by the code to be executed. Therefore, the present disclosure represents an improvement over existing data processing systems and computing systems in general.
[0016] The on-demand code execution system may include a virtual machine instance manager configured to receive user code (threads, programs, etc. written in any of a variety of programming languages) and execute the code in a highly scalable, low-latency manner without requiring the user to configure the virtual machine instance. Specifically, the virtual machine instance manager may create and configure the virtual machine instance according to a predetermined group of configurations before receiving the user code and before receiving any information about any particular virtual machine instance configuration from the user, each group of configurations corresponding to any one or more of a variety of runtime environments. Thereafter, the virtual machine instance manager receives a request to execute code initiated by the user, and identifies a preconfigured virtual machine instance to execute the code based on the configuration information associated with the request. The virtual machine instance manager may further allocate the identified virtual machine instance to execute the user's code at least in part by creating and configuring a container within the allocated virtual machine instance, and providing the task's code and dependency code objects to the container. Various embodiments for implementing a virtual machine instance manager and executing user code on virtual machine instances are described in more detail in U.S. Patent No. 9,323,556, entitled “PROGRAMMATIC EVENT DETECTION AND MESSAGE GENERATION FOR REQUESTS TO EXECUTE PROGRAM CODE,” filed on September 30, 2014 (“the '556 patent”), the entire contents of which are incorporated herein by reference.
[0017] As used herein, the term "virtual machine instance" is intended to refer to the execution of software or other executable code that simulates hardware to provide an environment or platform ("execution environment") on which the software can be executed. Virtual machine instances are generally executed by hardware devices that may be different from the physical hardware simulated by the virtual machine instance. For example, a virtual machine may simulate a processor and memory of a first type while executing on a processor and memory of a second type. Therefore, a virtual machine may be used to execute software intended for a first execution environment (e.g., a first operating system) on a physical device that is executing a second execution environment (e.g., a second operating system). In some cases, the hardware simulated by the virtual machine instance may be the same or similar to the hardware of the underlying device. For example, a device having a processor of a first type may implement multiple virtual machine instances, each virtual machine instance simulating an instance of that first type of processor. Therefore, a virtual machine instance may be used to divide the device into a certain number of logical sub-devices (each logical sub-device is called a "virtual machine instance"). Although virtual machine instances generally provide an abstract level of hardware away from the underlying physical device, this abstraction is not required. For example, assuming that a device implements multiple virtual machine instances, each of the multiple virtual machine instances simulates the same hardware as the hardware provided by the device. In such scenarios, each virtual machine instance can allow software applications to execute code on the underlying hardware without translation, while maintaining logical separation between software applications running on other virtual machine instances. This process, generally referred to as "native execution," can be used to increase the speed or performance of the virtual machine instance. Other technologies that allow direct utilization of the underlying hardware, such as hardware pass-through technology, can also be used.
[0018] Although a virtual machine executing an operating system is described herein as one example of an execution environment, other execution environments are possible. For example, a task or other process may be executed within a software "container" that provides a runtime environment without itself providing virtualization of the hardware. The container may be implemented within a virtual machine to provide additional security, or the container may be run external to a virtual machine instance.
[0019] Although exemplary embodiments are described herein with respect to processor instruction sets, it will be understood that the present disclosure is not limited to any particular computing resource or functionality. For example, the code may be analyzed to determine that it spends a large amount of time waiting for a storage device to read or write information, and it may be determined that a higher-speed data storage area (e.g., a memory cache or a solid-state device) is provided to facilitate more efficient execution of the code. As another example, the code or performance metrics may be analyzed to determine that providing a specific graphics processing unit ("GPU") will facilitate the execution of user-submitted tasks, and the identified GPU may be provided or simulated. As yet another example, the code may be analyzed to determine that it is optimized for a specific type of memory, such as a non-volatile random access memory ("NVRAM") or a dynamic random access memory ("DRAM"), and the specific type of memory may be supplied. The exemplary embodiments are therefore understood to be illustrative rather than restrictive.
[0020] In some embodiments, a user may submit code that requires a particular functionality or code that runs more efficiently if a certain functionality is provided without knowing dependencies. For example, the code submitted by the user may utilize a third-party library, and the library may require the functionality or make extensive use of the functionality if the functionality is available. In other embodiments, the user may know that a particular functionality is needed, but may not know whether the on-demand code execution system provides the functionality or whether the functionality is currently available if the functionality is provided. By implementing the embodiments described herein, the on-demand code execution system solves these problems and allows the user to submit code without identifying the required functionality, and without having to specifically request that the on-demand code execution system provide the functionality.
[0021] Embodiments of the present disclosure will now be described with reference to the accompanying drawings, wherein like numbers refer to like elements throughout. The terms used in the descriptions presented herein are not intended to be interpreted in any limiting or restrictive manner, simply because the terms are utilized in conjunction with the detailed description of certain specific embodiments of the present invention. In addition, embodiments of the present invention may include several novel features, a single feature of which is not solely responsible for its desired properties or essential to practicing the invention described herein.
[0022] Figure 11 is a block diagram of an illustrative operating environment 100 in which an on-demand code execution system 110 may operate based on communications with a user computing device 102, an auxiliary service 106, and a network-based data storage service 108. In general, the user computing device 102 may be any computing device, such as a desktop, laptop or tablet computer, a personal computer, a wearable computer, a server, a personal digital assistant (PDA), a hybrid PDA / mobile phone, a mobile phone, an electronic book reader, a set-top box, a voice command device, a camera, a digital media player, etc. The on-demand code execution system 110 may provide one or more user interfaces, command line interfaces (CLIs), application programming interfaces (APIs), and / or other programming interfaces to the user computing device 102 for the following operations: generating and uploading user executable code (e.g., including metadata identifying dependent code objects of the uploaded code); invoking user-provided code (e.g., submitting a request to execute user code on the on-demand code execution system 110); scheduling event-based jobs or timed jobs; tracking user-provided code; and / or viewing other logging or monitoring information related to their requests and / or user code. Although one or more embodiments may be described herein as using a user interface, it should be understood that these embodiments may additionally or alternatively use any CLI, API, or other programming interface.
[0023] The illustrative environment 100 also includes one or more network-based data storage services 108, which are configured to enable the on-demand code execution system 110 to store data and retrieve data from one or more persistent or substantially persistent data sources. Illustratively, the network-based data storage service 108 may enable the on-demand code execution system 110 to: store information corresponding to a task, such as code or metadata; store additional code objects representing dependencies of the task; retrieve data to be processed during the execution of the task; and store information about that execution (e.g., results). The network-based data storage service 108 may represent, for example, a relational or non-relational database. In another example, the network-based data storage service 108 may represent a network-attached storage device (NAS), which is configured to provide access to data arranged as a file system. The network-based data storage service 108 may further enable the on-demand code execution system 110 to query and retrieve information about data stored within the on-demand code execution system 110, such as by querying a number of related files or records, the size of those files or records, the file or record names, the file or record creation time, etc. In some cases, network-based data storage service 108 may provide additional functionality, such as the ability to separate data into logical groups (e.g., groups associated with separate accounts, etc.). Although illustrated as distinct from auxiliary services 106, network-based data storage service 108 may also represent a type of auxiliary service 106 in some cases.
[0024] The user computing device 102, auxiliary service 106 and network-based data storage service 108 can communicate with the on-demand code execution system 110 via a network 104, which may include any wired network, wireless network or a combination thereof. For example, the network 104 may be a personal area network, a local area network, a wide area network, an air broadcast network (e.g., for radio or television), a cable network, a satellite network, a cellular telephone network or a combination thereof. As another example, the network 104 may be a publicly accessible network of a link network that may be operated by various different parties, such as the Internet. In some embodiments, the network 104 may be a private network or a semi-private network, such as a company or university intranet. The network 104 may include one or more wireless networks, such as a global system for mobile communications (GSM) network, a code division multiple access (CDMA) network, a long-term evolution (LTE) network or any other type of wireless network. The network 104 may use protocols and components for communicating via any of the Internet or other aforementioned types of networks. For example, the protocols used by the network 104 may include Hypertext Transfer Protocol (HTTP), HTTP Secure (HTTPS), Message Queuing Telemetry Transport (MQTT), Constrained Application Protocol (CoAP), etc. Protocols and components for communicating via the Internet or any of the foregoing types of communication networks are well known to those skilled in the art and are therefore not described in further detail herein.
[0025] On-demand code execution system 110 Figure 1 is depicted as operating in a distributed computing environment that includes the use of one or more computer networks (in Figure 1 The on-demand code execution system 110 may also be configured to be configured to be connected to a plurality of computer systems (not shown) interconnected. Figure 1 The device shown in FIG. 1 may be operated in a computing environment with fewer or more devices than those shown in FIG. Figure 1 The on-demand code execution system 110 depicted in the should be considered illustrative rather than limiting of the present disclosure. For example, the on-demand code execution system 110 or its various components may implement various web service components, hosted or "cloud" computing environments, and / or peer-to-peer network configurations to implement at least a portion of the processes described herein.
[0026] In addition, the on-demand code execution system 110 can be implemented in direct hardware or software executed by a hardware device, and can include, for example, one or more physical or virtual servers implemented on physical computer hardware configured to execute computer executable instructions for performing various features described herein. One or more servers can be geographically dispersed or geographically co-located, for example, in one or more data centers. In some cases, one or more servers can operate as part of a system of rapidly provisioned and released computing resources (often referred to as a "cloud computing environment").
[0027] exist Figure 1 , the on-demand code execution system 110 is depicted as being connected to the network 104. In some embodiments, any of the components within the on-demand code execution system 110 may communicate with other components of the on-demand code execution system 110 via the network 104. In other embodiments, not all components of the on-demand code execution system 110 are capable of communicating with other components of the virtual environment 100. In one example, only the front end 120 (which may represent multiple front ends 120 in some cases) may be connected to the network 104, and other components of the on-demand code execution system 110 may communicate with other components of the environment 100 via the front end 120.
[0028] exist Figure 1 In the example, a user may interact with the on-demand code execution system 110 through the user computing device 102 to provide executable code, and establish rules or logic that define when and how such code should be executed on the on-demand code execution system 110, thus establishing a "task". For example, a user may want to run a piece of code in conjunction with a web or mobile application that the user has developed. One way to run the code would be to obtain a virtual machine instance from a service provider that provides infrastructure as a service; configure the virtual machine instance to suit the needs of the user; and use the configured virtual machine instance to run the code. To circumvent the complexity of this process, the user may alternatively provide the code to the on-demand code execution system 110 and request the on-demand code execution system 110 to execute the code. The on-demand code execution system 110 may handle the acquisition and configuration of computing capabilities (e.g., containers, instances, etc. described in more detail below) based on the code execution request, and use the computing capabilities to execute the code. The on-demand code execution system 110 can automatically scale based on volume, thereby alleviating the burden on users to have to worry about over-utilization (e.g., acquiring too few computing resources and suffering performance issues) or under-utilization (e.g., acquiring more computing resources than required to run the code, and therefore paying too much). According to embodiments of the present disclosure, and as described in more detail below, the on-demand code execution system 110 can use a customized operating system to configure a virtual machine instance to more efficiently execute a user's code and reduce utilization of computing resources.
[0029] In order to enable interaction with the on-demand code execution system 110, the system 110 includes one or more front ends 120 that enable interaction with the on-demand code execution system 110. In an illustrative embodiment, the front end 120 serves as a "front door" for other services provided by the on-demand code execution system 110, thereby enabling users to provide computer executable code (via the user computing device 102), request execution of the computer executable code, and view the results of the computer executable code. The front end 120 includes a variety of components to enable interaction between the on-demand code execution system 110 and other computing devices. For example, each front end 120 may include a request interface that provides the following capabilities to the user computing device 102: upload or otherwise transmit the user-specified code to the on-demand code execution system 110 and then request execution of that code. In one embodiment, the request interface communicates with an external computing device (e.g., user computing device 102, auxiliary service 106, etc.) via a graphical user interface (GUI), CLI, or API. The front end 120 processes the request and ensures that the request is properly authorized. For example, front end 120 may determine whether a user associated with the request is authorized to access a user code specified in the request.
[0030] Reference to user code used herein may refer to any program code (e.g., program, routine, subroutine, thread, etc.) written in a specific programming language. In the present disclosure, the terms "code", "user code" and "program code" may be used interchangeably. Such user code may be executed, for example, in conjunction with a specific web application or mobile application developed by a user to implement a specific function. As described above, a separate set of user code (e.g., to implement a specific function) is referred to herein as a "task", and the specific execution of that code (including, for example, compiling code, interpreting code, or otherwise enabling code to execute) is referred to as "task execution" or simply "execution". By way of non-limiting example, tasks may be written by JavaScript (e.g., node.js), Java, Python and / or Ruby (and / or another programming language). Tasks may be "triggered" in a variety of ways so as to be executed on the on-demand code execution system 110. In one embodiment, a user or other computing device may transmit a request to execute a task, which may generally be referred to as a "call" to execute the task. Such calls may include the user code to be executed (or its location) and one or more independent variables for executing the user code. For example, the call may provide the user code of the task and a request to execute the task. In another example, the call may identify the task by the name or identifier of the previously uploaded task. In another example, the code corresponding to the task may be included in the call to the task, and uploaded to a separate location (e.g., a storage device of the auxiliary service 106 or a storage system inside the on-demand code execution system 110) before the on-demand code execution system 110 receives the request. As described above, the code of the task may be referenced by using the identifier of the additional code object to those code objects maintained at the on-demand code execution system 110, so that the code object is combined with the code of the task in the execution environment, and then the task is executed. The on-demand code execution system 110 may change its execution strategy for the task based on where the code of the task is available when processing the call to the task. The request interface of the front end 120 may receive a call from a user to execute a task as a hypertext transfer protocol secure (HTTPS) request. Moreover, any information (eg, headers and parameters) included in the HTTPS request may also be processed and utilized when executing the task. As discussed above, any other protocol, including, for example, HTTP, MQTT, and CoAP, may be used to pass messages containing task calls to the request interface 122 .
[0031] The call of performing a task can specify one or more third-party libraries (including local libraries) to be used together with the user code corresponding to the task. In one embodiment, the call can provide a file to the on-demand code execution system 110, and the file contains the user code corresponding to the task requested to be executed and any library (and / or the identification of its storage location). In some embodiments, the call includes metadata, and the metadata indicates the program code of the task to be performed, the language of writing the program code, the user associated with the call and / or the computing resources (for example, memory, etc.) reserved for executing the program code. For example, the program code of the task can be provided by the call, previously uploaded by the user, provided by the on-demand code execution system 110 (for example, standard routines) and / or provided by a third party. Illustratively, the code that is not included in the call or previously not uploaded by the user can be referenced in the metadata of the task by using the URI associated with the code. In some embodiments, such resource level constraints (for example, how much memory will be allocated to execute a specific user code) are specified for a specific task, and can be unchanged during each execution of the task. In such cases, the on-demand code execution system 110 may have access to such resource level constraints before receiving each individual call, and individual calls may not specify such resource level constraints. In some embodiments, the call may specify other constraints, such as permission data, which indicates what kind of permission or authority the call is using to perform the task. Such permission data can be used by the on-demand code execution system 110 to access dedicated resources (e.g., on a private network). In some embodiments, individual code objects may also be associated with permissions or authorizations. For example, a third party may submit a code object and specify that the object can only be read by a subset of users. The on-demand code execution system 110 may include functionality to implement these permissions or authorizations regarding code objects.
[0032] In some embodiments, the call may specify the behavior that should be adopted to handle the call. In these embodiments, the call may include an indicator for enabling one or more execution modes in which the task referenced in the call is executed. For example, the call may include a flag or header for indicating whether the task should be executed in a debug mode, in which the debugging and / or logging output generated in conjunction with the execution of the task is provided back to the user (e.g., via a console user interface). In this example, the on-demand code execution system 110 may check the call and look for the flag or header, and if the flag or header exists, the on-demand code execution system 110 may modify the behavior of the container in which the task is executed (e.g., a logging facility) and cause the output data to be provided back to the user. In some embodiments, the behavior / mode indicator is added to the call through a user interface provided to the user by the on-demand code execution system 110. Other features, such as source code performance analysis, remote debugging, etc., may also be enabled or disabled based on the instructions provided in the call.
[0033] To manage requests for code execution, front end 120 may include an execution queue (in Figure 1 ), the execution queue can maintain a record of the requested task execution. Illustratively, the number of tasks that the on-demand code execution system 110 executes simultaneously is limited, and therefore, a new task execution initiated at the on-demand code execution system 110 (e.g., via an API call, via a call from a task being executed or being executed, etc.) can be placed on the execution queue 124 and processed, for example, in a first-in, first-out order. In some embodiments, the on-demand code execution system 110 may include multiple execution queues, such as a separate execution queue for each user account. For example, a user of the on-demand code execution system 110 may want to limit the rate of task execution on the on-demand code execution system 110 (e.g., for cost reasons). Therefore, the on-demand code execution system 110 can utilize an account-specific execution queue to throttle the rate of simultaneous task execution performed by a specific user account. In some cases, the on-demand code execution system 110 can prioritize task execution so that task executions of a specific account or a specified priority are bypassed or prioritized within the execution queue. In other cases, the on-demand code execution system 110 may execute a task immediately or substantially immediately after receiving a call for that task, and therefore, an execution queue may be omitted.
[0034] As described above, tasks may be triggered for execution at the on-demand code execution system 110 based on explicit calls from the user computing device 102 (e.g., received at a request interface). Alternatively or in addition, tasks may be triggered for execution at the on-demand code execution system 110 based on data retrieved from one or more auxiliary services 106 or a network-based data storage service 108. To facilitate interaction with the auxiliary services 106, the front end 120 may include a polling interface (in the Figure 1 108), the polling interface operates to poll the auxiliary service 106 or data storage service 108 for data. Illustratively, the polling interface may periodically transmit requests to one or more user-specified auxiliary services 106 or data storage services 108 to retrieve any newly available data (e.g., social network "posts", news articles, files, records, etc.), and determine whether the data corresponds to user-established criteria that triggers execution of a task on the on-demand code execution system 110. Illustratively, the execution criteria for a task may include, but are not limited to, whether new data is available at the auxiliary service 106 or data storage service 108, the type or content of the data, or timing information corresponding to the data. In some cases, the auxiliary service 106 or data storage service 108 may be used to notify the front end 120 of the availability of new data, and thus, with respect to such services, a polling service may be unnecessary.
[0035] In addition to tasks that are performed based on explicit user calls and data from auxiliary services 106, the on-demand code execution system 110 may in some cases be operable to independently trigger the execution of tasks. For example, the on-demand code execution system 110 may be operable (based on instructions from a user) to trigger the execution of a task at each of a number of specified time intervals (e.g., every 10 minutes).
[0036] The front end 120 may also include an output interface (in Figure 1 ), the output interface is configured to output information about the execution of the task on the on-demand code execution system 110. Illustratively, the output interface can transmit data about the task execution (e.g., the result of the task, errors related to the task execution, or details of the task execution, such as the total time required to complete the execution, the total data processed via the execution, etc.) to the user computing device 102 or the auxiliary service 106, which can include (for example) a billing or recording service. The output interface can also enable the transmission of data such as service calls to the auxiliary service 106. For example, the output interface can be utilized during the execution of the task to transmit API requests to the external service 106 (e.g., to store data generated during the execution of the task).
[0037] In some embodiments, the on-demand code execution system 110 may include multiple front ends 120. In these embodiments, a load balancer may be provided (in Figure 1 140A) to distribute incoming calls to multiple front ends 120, for example, in a round-robin manner. In some embodiments, the manner in which the load balancer distributes incoming calls to multiple front ends 120 may be based on the location or state of other components of the on-demand code execution system 110. For example, the load balancer may distribute calls to front ends 120 that are geographically nearby or have the ability to serve the calls. In the case where each front end 120 corresponds to a separate instance of another component of the on-demand code execution system (such as the active pool 140A described below), the load balancer may distribute the calls according to the capabilities or loads on those other components. As will be described in more detail below, in some cases, calls may be deterministically distributed among the front ends 120 so that a given call to perform a task will always (or almost always) be routed to the same front end 120. This may, for example, assist in maintaining an accurate record of the execution of the task, thereby ensuring that the task is executed only the desired number of times. Although the distribution of calls via a load balancer is illustratively described, other distribution techniques, such as anycast routing, will be apparent to those skilled in the art.
[0038] To perform tasks, the on-demand code execution system 110 includes one or more worker managers 140 that manage instances for servicing incoming calls to perform tasks. Figure 1 In the example illustrated in , each worker manager 140 manages an active pool of virtual machine instances 154A-C, which are currently assigned to one or more users and implemented by one or more physical host computing devices 150A-B. The physical host computing devices 150A-B and virtual machine instances 154A-C may further implement one or more containers 158A-F, which may contain and execute one or more user-submitted code 160A-G. A container is a logical unit created within a virtual machine instance or on a host computing device using resources available on that instance or device. For example, each worker manager 140 may create a new container based on information specified in a call to execute a task or locate an existing container 158A-F and assign the container to handle the execution of the task.
[0039] Containers 156A-F, virtual machine instances 154A-C, and host computing devices 150A-B may also include language runtimes, code libraries, or other support functionality that facilitates the execution of user-submitted code 160A-G (in Figure 1150A-B and virtual machine instances 154A-C may also include operating systems 152A-B and 156A-C. In various embodiments, operating systems 152A-B and 156A-C may be the same operating system, a variation of the same operating system, a different operating system, or a combination thereof.
[0040] Although virtual machine instances 154A-C are described here as being assigned to specific users, in some embodiments, instances 154A-C may be assigned to a group of users so that the instances are tied to the group of users and any member of the group may utilize resources on the instances. For example, users in the same group may belong to the same security group (e.g., based on their security certificates) so that after a member's task has been executed in a container on a specific instance, executing another member's task in another container on the same instance does not pose a security risk. Similarly, the worker manager 140 may assign instances and containers according to one or more policies that specify which requests can be executed in which containers and which instances can be assigned to which users. An exemplary policy may specify that instances are assigned to a collection of users sharing the same account (e.g., taking into account access to services provided by the on-demand code execution system 110). In some embodiments, requests associated with the same user group may share the same container (e.g., if the user code associated with the request is the same). In some embodiments, tasks do not distinguish between different users of the group, but simply indicate the group to which the user associated with the task belongs.
[0041] Once the front end 120 has successfully processed the triggering event for executing the task, the front end 120 passes the request to the worker manager 140 to execute the task. In one embodiment, each front end 120 may be associated with a corresponding worker manager 140 (e.g., a worker manager 140 located at the same place or geographically near the front end 120), and therefore, the front end 120 may pass most or all requests to that worker manager 140. In another embodiment, the front end 120 may include a location selector configured to determine the worker manager 140 to which the execution request is passed. In one embodiment, the location selector may determine the worker manager 140 to receive the call based on hashing the call, and distribute the call to the worker manager 140 selected based on the hash value (e.g., via a hash ring). Those skilled in the art will appreciate various other mechanisms for distributing calls between worker managers 140. According to an embodiment of the present disclosure, the worker manager 140 may determine the host computing device 150A-B or virtual machine instance 154A-C for executing the task based on a recommendation from the simulation provisioning system 170.
[0042] The on-demand code execution system 110 also includes a simulation provisioning system 170, which implements various aspects of the present disclosure, including, for example, determining how to provide functionality that may be required for a particular task. In some embodiments, the simulation provisioning system 170 includes a code analyzer 162, which can be called when a user submits code via the front end 120 to statically analyze the submitted code and determine the functionality required for the submitted code. As described in more detail below, the code analyzer 162 can analyze the user's code and identify, for example, API calls, operating system calls, function calls, or other indications of functionality that the code will require during execution. In various embodiments, the code analyzer 162 can analyze keywords, symbols, headers, indications, or other aspects of the user's code. In other embodiments, the on-demand code execution system 110 includes an execution analyzer 164, which can be called when the user's code is executed to analyze the performance of the executed code and the functionality actually utilized during the execution of the code. The execution analyzer 164 can identify, for example, a portion of the source code that requires specific functionality but is extremely difficult to access during execution. In other embodiments, the simulation provisioning system 170 may include a computing resource data store 176 that may store information regarding functionality provided by the various host computing devices 150A-B or emulated by the various virtual machine instances 154A-C.
[0043] like Figure 1 As shown in , various combinations and configurations of host computing devices 150A-B, virtual machine instances 154A-C, and containers 158A-F can be used to facilitate the execution of user-submitted code 160A-G. In the illustrated example, host computing device 150A implements two virtual machine instances 154A and 154B. Virtual machine instance 154A in turn implements two containers 158A and 158B, which contain user-submitted code 160A and 160B, respectively. Virtual machine instance 154B implements a single container 158C, which contains user-submitted code 160C. Host computing device 150B further implements virtual machine instance 154C and directly implements containers 158E and 158F, which contain user-submitted code 160F and 160G. Virtual machine instance 154C in turn implements container 158D, which contains user-submitted code 160D and 160E. It will be understood that these embodiments are described for the purpose of example, and many other embodiments are within the scope of the present disclosure.
[0044] Although some functionality is generally described herein with reference to separate components of the on-demand code execution system 110, other components or combinations of components may additionally or alternatively implement such functionality. For example, the worker manager 140 may be operable to provide functionality associated with the execution of user-submitted code as described herein with reference to the simulation provisioning system 170.
[0045] Figure 2 A general architecture of a computing system (referenced as simulation provisioning system 170) that operates to determine how functionality used by a particular task should be provided within on-demand code execution system 110. Figure 2 The general architecture of the simulation provisioning system 170 depicted in FIG. 1 includes an arrangement of computer hardware and software modules that can be used to implement various aspects of the present disclosure. The hardware modules can be implemented using physical electronic devices, as discussed in more detail below. The simulation provisioning system 170 may include more than the Figure 2 However, it is not necessary to show all of these generally conventional elements in order to provide a disclosure with broad applicability. Figure 2 The general architecture shown in FIG. 1 can be used to implement Figure 1 104. As shown, the simulation provisioning system 170 includes a processor 202, an input / output device interface 204, a network interface 206, and a data storage area 208, all of which can communicate with each other via a communication bus. The network interface 292 can provide connectivity to one or more networks or computing systems. The processor 202 can therefore receive information and instructions from other computing systems or services via the network 104. The processor 202 can also communicate with the memory 280, and further provide output information for an optional display (not shown) via the input / output device interface 204. The input / output device interface 296 can also receive input from an optional input device (not shown).
[0046] The memory 220 may include computer program instructions (grouped into modules in some embodiments) that the processor 202 executes to implement one or more aspects of the present disclosure. The memory 220 generally includes a random access memory (RAM), a read-only memory (ROM), and / or other persistent, auxiliary, or non-temporary computer-readable media. The memory 220 may store an operating system 222 that provides computer program instructions for the processor 202 to use in general management and operation of the simulation supply system 170. The memory 220 may also include computer program instructions and other information for implementing various aspects of the present disclosure. For example, in one embodiment, the memory 220 includes a user interface module 224 that generates a user interface (and / or instructions for the user interface) for display on a computing device, for example, via a navigation and / or browsing interface such as a browser or application installed on a computing device. In addition, the memory 220 may include one or more data repositories (not shown) and / or communicate with one or more data repositories, for example, to access user program code and / or libraries.
[0047] The memory 220 may include a code analyzer 172 and an execution analyzer 174 executable by the processor 202 to supplement and / or be combined with the user interface module 224. In one embodiment, the code analyzer 172 and the execution analyzer 174 individually or collectively implement various aspects of the present disclosure, such as analyzing code or code execution to determine desired functionality and efficiently providing that functionality, as further described below.
[0048] Although the code analyzer 172 and the execution analyzer 174 Figure 2 170, but in other embodiments, all or a portion of the code analyzer 172 and the execution analyzer 174 may be implemented by other components of the on-demand code execution system 110 and / or another computing device. For example, in certain embodiments of the present disclosure, another computing device in communication with the on-demand code execution system 110 may include several modules or components that operate similarly to the modules and components depicted as part of the simulation provisioning system 170.
[0049] The memory 220 may also include user submitted code 160, which may be loaded into the memory along with a user submitted request to perform a task on the on-demand code execution system 110. The code 160 may illustratively be analyzed by the code analyzer 172 to identify desired functionality, as described in more detail below. The memory 220 may also include execution performance metrics 226, which may be collected from physical or virtual machines when the code 160 is executed on these platforms and may be analyzed by the execution analyzer 174.
[0050] In some embodiments, the simulation provisioning system 170 may also include, in addition to Figure 2 For example, memory 220 may also include computing resource information identifying functionality provided by various physical and virtual computing resources that may be used to execute user-submitted code 160, or may include metadata or other information submitted with the request, such as an indication that user-submitted code 160 was compiled for execution on computing resources that provide specific functionality. Figure 2 The present invention is therefore to be regarded as illustrative rather than restrictive.
[0051] Figure 3 Depicts an illustrative interaction for determining computing resources to use when executing a task based on an analysis of user-submitted code for the task. At (1), a user device 102 submits a request to the front end 120 of an on-demand code execution system to execute a task. The request may include the user-submitted code, or in some embodiments may identify user code that has been previously submitted. At (2), the front end 120 requests the code analyzer 172 to analyze the user-submitted code to identify functionality that the code may require during execution. Illustratively, the user-submitted code may utilize a specific instruction set (where available), such as an instruction set that implements vector instructions, floating-point instructions, fused multiply-add instructions, neural network instructions, tensor processing instructions, single instruction multiple data ("SIMD") instructions, cryptographic instructions, and the like. A physical processor may implement one or more of these instruction sets. A virtual processor in a virtual machine may also implement one or more of these instruction sets, where the execution results differ depending on the interaction between the virtual machine and the underlying physical computing resources.
[0052] At (3), code analyzer 172 may request computing resource data from computing resource data store 176. The computing resource data may indicate, for example, specific computing resources that are available within on-demand code execution system 110 to execute the user-submitted code, and may further indicate functionality associated with these computing resources, the performance of these computing resources in providing the specified functionality, and other parameters or information that enable code analyzer 172 to determine the recommended computing resources. At (4), computing resource data store 176 may provide the requested computing resource data. In some embodiments, computing resource data store 176 may only provide data about available computing resources. In other embodiments, computing resource data store 176 may provide data about unavailable computing resources (e.g., because they are currently being used to execute code submitted by other users), and code analyzer 172 may determine whether to make these resources available by, for example, migrating other tasks.
[0053] At (5), the code analyzer 172 may determine a set of computing resources to use when executing the user-submitted code. In some embodiments, the code analyzer 172 may generate recommendations that the worker manager 140 may optionally implement based on resource availability, prioritization of requested tasks, and other factors. In other embodiments, the code analyzer 172 may consider some or all of these factors when making its determination, and may determine a set of computing resources for the worker manager 140 to allocate. The code analyzer 172 may analyze instructions, operations, functions, API calls, libraries, or other aspects of the user-submitted code to identify functionality that the code can use, and may identify computing resources that provide this functionality. For example, the code analyzer 172 may analyze the user-submitted code and identify that the user-submitted code has been compiled for execution on a specific processor (e.g., by setting a specific flag at compile time), or identify that the user-submitted code includes a library that frequently uses floating-point arithmetic. In some embodiments, the code analyzer 172 may obtain information about previous executions of the user-submitted code, and determine the functionality used by the code on that basis. In other embodiments, code analyzer 172 may obtain information about other code submitted by the same user, and may evaluate whether the user's submission frequently utilizes a particular functionality. Code analyzer 172 may further analyze data, such as user priorities or preferences, and may analyze computing resource data to consider factors such as limited availability of particular resources (which may be expressed as resource costs), overall demand for certain computing resources, prioritization of requests and tasks, or other considerations.
[0054] At (6), code analyzer 172 provides resource recommendations to front end 120, and at (7), front end 120 provides resource recommendations and user-submitted code to worker manager 140. In some embodiments, the interaction at (6) may be omitted, and code analyzer 172 may provide resource recommendations directly to worker manager 140. In other embodiments, the interactions at (6) and (7) may be combined, and code analyzer 172 may provide both user-submitted code and recommendations to worker manager 140. In other embodiments, worker manager 140 may perform the interaction at (2) and request resource recommendations from code analyzer 172. In various embodiments, front end 120 or code analyzer 172 may provide an identifier or other information that allows worker manager 140 to obtain user-submitted code rather than directly providing the user-submitted code.
[0055] At (8), in some embodiments, worker manager 140 may determine the availability of resources recommended by code analyzer 172. In some embodiments, code analyzer 172 may provide a prioritized or sorted list of potential computing resources for executing user-submitted code, and worker manager 140 may determine the "best available" resource by comparing the prioritized list to the available resource pool. In other embodiments, code analyzer 172 may provide scores or weighting factors for various potential computing resources (or relative priorities of tasks), and worker manager 140 may determine computing resources based on these factors. In other embodiments, as described above, code analyzer 172 may consider resource availability when determining a set of computing resources, and the interaction at (8) may be omitted, or the interaction may be a determination that tasks must be migrated from one resource to another to free up resources to be used to execute newly submitted tasks.
[0056] At (9), the worker manager 140 may allocate computing resources to be used to execute the code submitted by the user. In various embodiments, allocating computing resources may include: allocating a host computing device 150A; allocating an existing virtual machine instance (in Figure 3 ); the new virtual machine instance (in Figure 3 ), instantiated (not shown); or a combination thereof. In some embodiments, as described above, worker manager 140 may allocate computing resources other than the computing resources recommended by code analyzer 142. For example, if the computing resources recommended by code analyzer 142 are not available, worker manager 140 may determine alternative resources based on the recommendation or resource availability. At (10), host computing device 150A or other allocated computing resources executes the user-submitted code.
[0057] In some embodiments, the ordering and implementation of the operations described above may be modified, or these interactions may be performed by additional or alternative elements of the on-demand code execution system 110. For example, in some embodiments, the worker manager 140 may be configured to analyze performance metrics and, in response to the metrics satisfying certain criteria, request resource recommendations from the execution analyzer 174. As another example, code analysis may be performed prior to receiving a request to execute user-submitted code, and the results of such analysis may be stored (e.g., in the computing resource data store 176) for later use when requesting code execution.
[0058] Figure 4Depicts an illustrative interaction for determining computing resources to use in executing a task based on an analysis of a current or previous execution of the task. At (1), a computing resource (such as a host computing device 150A or a virtual machine instance executing on the host computing device 150A) that is executing a task collects performance metrics about the execution of the task. The performance metrics may include, for example, the number of processor instructions executed per clock cycle, which may provide an indication of how effectively the virtual machine instance is emulating a processor that is not physically provided. In various embodiments, the performance metrics may include measurements such as total execution time, computing resources utilized (or not utilized) during execution, and the like. At (2), the computing resource reports the execution metrics to an execution analyzer 174. In various embodiments, the computing resource may report the metrics during execution of the task or after the task is completed.
[0059] At (3), the execution analyzer 174 may determine the recommended computing resources. Illustratively, the execution analyzer 174 may determine that a different set of computing resources may execute the code more efficiently based on the execution metrics. For example, the execution analyzer 174 may determine that the code is performing several operations that would be more efficiently executed on a different computing resource (e.g., a processor that implements a particular instruction set). As another example, the execution analyzer 174 may determine that the code uses little or no computing resources, and therefore the code may be migrated to a different computing resource without significantly affecting performance. In some embodiments, the execution analyzer 174 may obtain information about other computing resources that may be used to execute the code from the computing resource data store 176, and may estimate the performance of executing the code on those resources relative to the received performance metrics.
[0060] At (4), execution analyzer 174 may store the updated computing resource data to computing resource data store 176. Illustratively, execution analyzer 174 may store that a particular set of computing resources executed the code with a particular degree of efficiency (or inefficiency) based on the collected performance metrics, and this information may be used to improve subsequent analysis performed by execution analyzer 174 or code analyzer 172. In some embodiments, as discussed above, execution analyzer 174 may store that computing resources are underutilized or that particular functionality is required but not present when executing the code. In some embodiments, execution analyzer 174 may analyze the results of multiple executions of various user-submitted code to identify trends or patterns that may facilitate the allocation of computing resources to execute user-submitted code.
[0061] At (5), in some embodiments, the execution analyzer 174 may provide updated resource recommendations to the worker manager 140. In some embodiments, as discussed above, the execution analyzer 174 may consider several factors, such as resource availability and prioritization, and may direct the worker manager 140 to migrate the user-submitted code to a different set of computing resources. In other embodiments, the execution analyzer 174 may provide recommendations, and the worker manager 140 may determine whether to implement the recommendations. In these embodiments, at (6), the worker manager 140 may determine whether computing resources are available or can be made available to implement the recommendations of the execution analyzer 174. In some embodiments, the worker manager 140 or the execution analyzer 174 may consider whether the estimated performance gain achieved by migrating the executed code to a different set of computing resources outweighs any costs associated with the migration, such as the transfer of execution state or the costs associated with vacating the resources. In other embodiments, the worker manager 140 or the execution analyzer 174 may aggregate or prioritize the recommendations to ensure that resources are allocated efficiently overall.
[0062] At (7), the worker manager 140 may migrate the execution of the user-submitted code from one set of computing resources to another set of computing resources. For example, the worker manager 140 may migrate the execution of the code from the host computing device 150A to another host computing device 150B that implements different functionality. In various embodiments, the worker manager 140 may migrate code execution from one physical computing device to another physical computing device, from one virtual machine instance to another virtual machine instance, from a physical computing device to a virtual machine instance (or vice versa), or a combination thereof. In some embodiments, the worker manager 140 may migrate code execution by: suspending execution on the host computing device 150A; migrating the code and state information to the host computing device 150B; and subsequently resuming code execution on the host computing device 150B and releasing the resources on the host computing device 150A that had executed the code. In other embodiments, the worker manager 140 may migrate code execution by terminating the ongoing execution on the host computing device 150A and resuming it on the host computing device 150B. In other embodiments, the worker manager may perform a "live" migration and may begin execution on host computing device 150B without suspending execution on host computing device 150A, or may execute in parallel on both devices 150A-B for a period of time before the migration is completed. Other embodiments of migrating executed code will be understood to be within the scope of the present disclosure. At (8), host computing device 150A may suspend its execution of the user-submitted code, and at (9), host computing device 150B (or other physical or virtual computing device) may resume execution of the code from the point where execution was suspended.
[0063] In some embodiments, execution analyzer 174 may determine a set of computing resources to be used when the user-submitted code is next executed, and may provide this recommendation to code analyzer 172, worker manager 140, or store the recommendation in computing resource data store 176. Additionally, in some embodiments, execution analyzer 174 may make a determination or recommendation at the beginning of a subsequent execution of the code based on performance metrics collected during previous executions, which may supplement or replace code-based analysis for subsequent executions.
[0064] In some embodiments, the reporting of execution metrics at (2) may be performed continuously during the execution of the user-submitted code, and the execution analyzer 174 may dynamically analyze whether the user-submitted code requires different computing resources at various points during the execution of the user-submitted code. For example, the execution analyzer 174 may determine that the user-submitted code has begun or ended an execution phase that utilizes a certain functionality, and may recommend making that functionality available or indicate that the functionality is no longer needed. In addition, in some embodiments, the worker manager 140 may request the execution analyzer 174 to provide a recommendation for a specific computing resource (e.g., a computing resource that has become available), and may receive a recommendation to migrate the execution of the specific user-submitted code to the resource.
[0065] Figure 5 is a flow chart of an illustrative routine 500 for determining a set of computing resources to recommend based on an analysis of user-submitted code. The routine 500 may be performed, for example, by Figure 1 The routine 500 begins at block 502, where code for a task (e.g., submitted by a user) is obtained. In one embodiment, the code for the task is represented as a code object, such as a compressed file comprising the source code of the task. At block 504, the code is analyzed to identify functionality that may be needed during code execution. As described above, the code may be analyzed with respect to libraries, programming language features, API calls, or other features to identify functionality that may be useful for providing during code execution. In some embodiments, the code may be compared with other code executed by the on-demand code execution system 110, and common features or similarities may be identified.
[0066] At box 506, available computing resources may be identified. In some embodiments, as described above, computing resources may be identified regardless of their availability. In various embodiments, availability may be considered in terms of availability (e.g., there are resources) and availability (e.g., resources are idle or may be released) within a particular data center. At box 508, multiple groups of computing resources providing the identified functionality may be identified as potential candidates for executing user-submitted code. A group of computing resources may include, for example, various physical or virtual resources, such as processors, memory, interfaces, data storage areas, etc. In some embodiments, virtual computing resources may be associated with a specific host computing environment. For example, a virtual processor may be associated with an underlying physical processor to evaluate the performance of the virtual processor when providing the required functionality.
[0067] At block 510, a set of resources that have not been analyzed by this execution of routine 500 may be selected. At block 512, the performance of this set of resources may be estimated with respect to executing the user-submitted code. The performance may be estimated, for example, based on a benchmark, a metric, a previous execution, or other criteria. In various embodiments, the performance estimate may be expressed in terms of a numerical score, a grade, a category (e.g., high, medium, and low), or other format that enables comparison.
[0068] At decision block 514, it may be determined whether routine 500 has analyzed the computing resources of all candidate groups. If not, routine 500 branches to block 510 and iterates through blocks 512 and 514 until the computing resources of all groups have been analyzed. Once all resource groups have been analyzed, routine 500 branches to block 516, where a group of computing resources to be recommended may be determined based on performance estimates. In some embodiments, the group of computing resources with the highest estimated performance may be recommended. In other embodiments, the group of computing resources may be associated with cost, scarcity, or other criteria that may be considered for recommendation. For example, scarce computing resources may be allocated only when the difference in performance associated with widely available computing resources exceeds a threshold.
[0069] At block 518, the code may be executed using a recommended set of computing resources. In some embodiments, as described above, the recommended set of computing resources may be a factor in allocating computing resources and may be weighted with other considerations such as resource availability or cost. In other embodiments, a prioritized list of candidate computing resources may be output and may be used to determine the computing resources to use when executing the code. In other embodiments, the routine 500 may determine that a particular resource should be made available, and may identify another task (and associated user-submitted code) to be migrated in order to free up the resource based on the estimated or measured performance of various tasks being executed on the particular resource that is to be made available.
[0070] Figure 6 6 is a flow chart of an illustrative routine 600 for determining a set of computing resources to recommend based on an analysis of execution performance metrics. The routine 600 may be performed, for example, by Figure 1 The routine 600 begins at block 602, where performance metrics associated with executing user-submitted code for a specified task on a particular set of computing resources may be obtained. In some embodiments, as described above, the performance metrics may be obtained during execution of the code. In other embodiments, the performance metrics may be obtained periodically, in response to various events (e.g., computing resources become available or unavailable, code calls a particular library or API call, etc.), or based on other criteria. In other embodiments, the performance metrics may be obtained after the code has completed execution.
[0071] At block 604, the performance metric may be analyzed. In some embodiments, the performance metric may be compared to a threshold or other criteria to assess whether the performance of the set of computing resources is satisfactory. For example, the performance metric may be used to assess whether the number of instructions executed per clock cycle meets a threshold, or to assess whether code execution is completed within a time interval. In other embodiments, the performance metric may be analyzed relative to other performance metrics, such as metrics obtained when executing the same or similar code on a different set of computing resources, metrics obtained when executing other code on the same set of computing resources, or average or baseline performance metrics.
[0072] At decision box 606, it can be determined whether the relative performance of the group of computing resources when executing the code submitted by the user is acceptable. If the relative performance is comparable to or better than the baseline, routine 600 can end without taking any measures to improve performance. In some embodiments, when the relative performance is better than average, routine 600 can be forked to frame 618 and store performance metrics or other information, and this information can be used when further recommending which computing resources to use when executing the code submitted by the user for a specific task. In other embodiments, when the relative performance is higher than the required performance, routine 600 can be forked to frame 608, and consider migrating tasks to other computing resources. For example, a user can require to complete a specific task within a specified amount of time, and the group of computing resources can enable the task to be completed much faster than required by the user. The determination at decision box 606 can therefore be that the task can be completed on a slower group of computing resources and still meet the performance requirements of the user, and therefore the task should be migrated to free up faster computing resources for more time-critical tasks.
[0073] If the determination at decision block 606 is that execution of the user-submitted code should be migrated to a different set of computing resources, then the routine 600 branches to block 608, where available computing resources can be identified. At block 610, the available computing resources can be analyzed to identify an alternative set of computing resources that can be used to perform the task, and at block 612, the performance of the alternative set of computing resources in performing the task can be estimated. In some embodiments, multiple sets of computing resources can be identified and analyzed, and block 612 can be performed iteratively for each candidate set. In other embodiments, an alternative set of computing resources can be identified based on the relative performance of the current set of computing resources.
[0074] At decision box 614, it can be determined whether the execution of the code submitted by the user should be migrated to the alternative group of computing resources from a current group of computing resources. In some embodiments, it can be determined based on the performance metric obtained and estimated whether the alternative group of computing resources will provide better performance. For example, the determination can be that the alternative group of computing resources will perform more instructions than the current group of computing resources in each clock cycle, and therefore will cause performance improvement. In other embodiments, it can be determined based on standards such as execution time, cost, resource utilization or other metrics whether the alternative group of computing resources provides acceptable performance. In these embodiments, a current group of computing resources can provide a higher performance than a current group of computing resources, but other factors discussed above can cause determination to use the alternative group of computing resources. If the determination at decision box 614 is that execution should not be migrated, routine 600 ends.
[0075] If the determination at decision block 614 is that code execution should be migrated, then at block 616, code execution is migrated to the alternative set of computing resources. At block 618, the obtained or estimated performance metrics may be stored to improve the accuracy of the estimate or to improve the decision when initially allocating computing resources, as discussed above. Routine 600 then ends.
[0076] The blocks of the routines described above may vary in embodiments of the present disclosure. For example, in some implementations of any of the routines, the identification of available computing resources may be pushed or delegated to the worker manager 140, and the routines 500 or 600 may provide recommendations that the worker manager 140 determines whether to implement based on factors such as resource availability and the cost-effectiveness of migrating tasks from one set of resources to another set of resources. According to various embodiments, the routines may also include additional blocks, or the blocks of the routines may be rearranged.
[0077] It will be understood that not necessarily all objects or advantages may be achieved in accordance with any particular embodiment described herein. Thus, for example, those skilled in the art will recognize that certain embodiments may be configured to operate in a manner that achieves or optimizes one advantage or group of advantages as taught herein without necessarily achieving other objects or advantages that may be taught or suggested herein.
[0078] All of the processes described herein may be embodied in and entirely automatically via a software code module comprising one or more specific computer executable instructions executed by a computing system. The computing system may include one or more computers or processors. The code module may be stored in any type of non-transitory computer readable medium or other computer storage device. Some or all of the methods may be embodied in dedicated computer hardware.
[0079] Many other variations in addition to those described herein will be apparent in light of this disclosure. For example, depending on the implementation, certain actions, events, or functions of any of the algorithms described herein may be performed in a different order, may be added, merged, or omitted entirely (e.g., not all of the described actions or events are necessary for the practice of the algorithms). Furthermore, in certain implementations, actions or events may be performed simultaneously (e.g., by multithreading, interrupt handling, or multiple processors or processor cores or on other parallel architectures) rather than sequentially. Additionally, different tasks or processes may be performed by different machines and / or computing systems that may run together.
[0080] The various illustrative logical blocks and modules described in conjunction with the embodiments disclosed herein may be implemented or executed by a machine, such as a processing unit or processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. The processor may be a microprocessor, but in an alternative, the processor may be a controller, a microcontroller or a state machine, a combination thereof, or the like. The processor may include a circuit configured to process computer executable instructions. In another embodiment, the processor includes an FPGA or other programmable device that performs logical operations without processing computer executable instructions. The processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, a combination of one or more microprocessors and a DSP core, or any other such configuration. Although this article is primarily described with respect to digital technology, the processor may also primarily include analog components. The computing environment may include any type of computer system, including, but not limited to, a computer system based on a microprocessor, a mainframe computer, a digital signal processor, a portable computing device, a device controller, or a computing engine within an appliance (to name a few).
[0081] Unless expressly provided otherwise, conditional language, such as, inter alia, "can," "may," "might," or "could," should be otherwise understood within the context as being generally used to convey that certain embodiments include certain features, elements, and / or steps, while other embodiments do not. Thus, such conditional language is generally not intended to imply that one or more embodiments require features, elements, and / or steps in any way, or that one or more embodiments necessarily include logic for deciding, with or without user input or prompting, whether such features, elements, and / or steps are included or will be performed in any particular embodiment.
[0082] Unless expressly provided otherwise, connective language such as the phrase "at least one of X, Y, or Z" is otherwise understood in context as being generally used to present that an item, term, etc. can be X, Y, or Z, or any combination thereof (e.g., X, Y, and / or Z). Thus, such connective language is generally not intended to, and will not, imply that certain embodiments require the presence of at least one of X, at least one of Y, or at least one of Z.
[0083] Any process description, element or box in the flowchart described herein and / or depicted in the accompanying drawings should be understood to potentially represent a module, segment or portion of code including one or more executable instructions for implementing a specific logical function or element in the process. Those skilled in the art will appreciate that alternative implementations are included within the scope of the embodiments described herein, wherein elements or functions may be deleted, executed in an order different from that shown or discussed, including substantially simultaneously or in reverse order, depending on the functionality involved.
[0084] Unless expressly provided otherwise, articles such as "a" or "an" are generally understood to include one or more of the described items. Thus, phrases such as "a device configured to..." are intended to include one or more of said devices. Such one or more of said devices may also be collectively configured to perform the stated statements. For example, "a processor configured to perform statements A, B, and C" may include a first processor configured to perform statement A working in conjunction with a second processor configured to perform statements B and C.
[0085] Examples of embodiments of the present disclosure may be described in terms of the following:
[0086] Item 1. A system comprises: a non-transitory data storage area, which stores information about physical and virtual processors; and a computing device, which is configured with executable instructions to: receive user-submitted code that can be executed on an on-demand code execution system; identify an instruction set associated with the user-submitted code, wherein the user-submitted code utilizes the instruction set when executed on the on-demand code execution system; and in response to a request to execute the user-submitted code: obtain availability information about a physical processor that implements the instruction set; obtain first performance information about the physical processor; obtain second performance information about a virtual processor that implements the instruction set; determine a recommended processor for executing the user-submitted code based at least in part on the availability information, the first performance information, and the second performance information; and cause the on-demand code execution system to execute the user-submitted code on the recommended processor.
[0087] Clause 2. A system according to clause 1, wherein the instruction set includes vector instructions, floating point instructions, fused multiply-add instructions, neural network instructions, tensor processing instructions, single instruction multiple data instructions, security instructions or cryptographic instructions.
[0088] Clause 3. The system of clause 1, wherein the instruction set is identified based at least in part on a software library called upon by the user-submitted code.
[0089] Clause 4. The system of Clause 1, wherein the second performance information is associated with instantiating the virtual processor on a physical processor that does not implement the instruction set.
[0090] Clause 5. The system of clause 1, wherein the user submitted code is compiled for the physical processor.
[0091] Clause 6. A computer-implemented method comprises: receiving user-submitted code capable of being executed on an on-demand code execution system; determining functionality associated with executing the user-submitted code on the on-demand code execution system based at least in part on the user-submitted code; and in response to a request to execute the user-submitted code: obtaining first performance information about a first computing resource that implements the functionality; obtaining second performance information about a second computing resource that emulates the functionality; determining a recommended computing resource for executing the user-submitted code based at least in part on the first performance information and the second performance information; and providing a recommendation including the recommended computing resource to the on-demand code execution system, wherein the on-demand code execution system selects a computing resource for executing the user-submitted code based at least in part on the recommendation.
[0092] Clause 7. The computer-implemented method of Clause 6, wherein at least one of the first performance information and the second performance information was generated during a previous execution of the user-submitted code on the on-demand code execution system.
[0093] Clause 8. A computer-implemented method according to Clause 6, wherein the computer-implemented method further comprises: obtaining performance metrics from the on-demand code execution system regarding the use of selected computing resources to execute the user-submitted code; identifying alternative computing resources based at least in part on the performance metrics; and providing updated recommendations including the alternative computing resources to the on-demand code execution system, wherein providing the updated recommendations causes the on-demand code execution system to migrate execution of the user-submitted code to different computing resources.
[0094] Clause 9. The computer-implemented method of Clause 8, wherein the performance metric comprises a number of processor instructions executed per clock cycle.
[0095] Clause 10. The computer-implemented method of Clause 8, further comprising determining that the alternative computing resource is available.
[0096] Clause 11. The computer-implemented method of Clause 6, wherein the first computing resource is a physical computing resource and the second computing resource is a virtual computing resource.
[0097] Clause 12. The computer-implemented method of Clause 6, further comprising identifying the first computing resource and the second computing resource based at least in part on functionality associated with executing the user-submitted code.
[0098] Clause 13. The computer-implemented method of Clause 6, further comprising aggregating a plurality of previous recommendations for computing resources to determine a recommended hardware configuration for the on-demand code execution system.
[0099] Clause 14. The computer-implemented method of Clause 13, wherein the recommended hardware configuration is based at least in part on one or more trends in the plurality of previous recommendations.
[0100] Clause 15. The computer-implemented method of Clause 13, wherein the recommended hardware configuration is based at least in part on a performance metric.
[0101] Clause 16. The computer-implemented method of Clause 6, wherein the first computing resource implements the functionality by emulating the functionality.
[0102] Clause 17. Non-transitory computer-readable media includes computer-executable instructions that, when executed by an on-demand code execution system, cause the on-demand code execution system to: obtain user-submitted code that is capable of being executed on the on-demand code execution system; determine functionality associated with executing the user-submitted code on the on-demand code execution system based at least in part on the user-submitted code, wherein the on-demand code execution system does not receive a request to provide the functionality; identify multiple computing resources that implement the functionality; in response to a request to execute the user-submitted code: identify an available subset of the multiple computing resources; select a recommended computing resource from the available subset for executing the user-submitted code; and execute the user-submitted code on the recommended computing resource.
[0103] Clause 18. A non-transitory computer-readable medium as described in Clause 17, wherein the non-transitory computer-readable medium includes other computer-executable instructions that, when executed by the on-demand code execution system, cause the on-demand code execution system to perform the following operations: generate a prioritized list of computing resources based at least in part on performance estimates of individual computing resources among the multiple computing resources.
[0104] Clause 19. A non-transitory computer-readable medium according to Clause 17, wherein the non-transitory computer-readable medium includes other computer executable instructions that, when executed by the on-demand code execution system, cause the on-demand code execution system to perform the following operations: determine, based at least in part on a performance estimate of an unavailable computing resource, to migrate at least one other task to make the unavailable computing resource available.
[0105] Clause 20. The non-transitory computer-readable medium of Clause 17, wherein the request to execute the user-submitted code specifies a preferred computing resource for executing the user-submitted code, and wherein the preferred computing resource does not provide the functionality.
[0106] Clause 21. A non-transitory computer-readable medium as described in clause 20, wherein the recommended computing resource is determined at least in part based on the following operation: comparing a performance estimate for executing the user-submitted code on the recommended computing resource with a performance estimate for executing the user-submitted code on the preferred computing resource.
Claims
1. A system, comprising: a non-transitory data store storing information about physical and virtual processors; as well as A computing device configured with executable instructions to: receiving user-submitted code that can be executed on the on-demand code execution system; identifying a processor instruction set associated with the user-submitted code, wherein the user-submitted code utilizes the processor instruction set when executed on the on-demand code execution system; and In response to a request to execute the user-submitted code: obtaining information regarding availability of a physical processor that implements the processor instruction set; Obtaining first performance information about the physical processor; obtaining second performance information about a virtual processor that implements the processor instruction set; determining a recommended processor for executing the user-submitted code based at least in part on the availability information, the first performance information, and the second performance information; as well as The on-demand code execution system is caused to execute the user-submitted code on the recommended processor.
2. The system of claim 1, wherein the processor instruction set comprises vector instructions, floating point instructions, fused multiply-add instructions, neural network instructions, tensor processing instructions, single instruction multiple data instructions, security instructions, or cryptographic instructions.
3. The system of claim 1, wherein the processor instruction set is identified based at least in part on a software library called upon by the user-submitted code.
4. The system of claim 1, wherein the second performance information is associated with instantiating the virtual processor on a physical processor that does not implement the processor instruction set.
5. A computer-implemented method, the computer-implemented method comprising: receiving user-submitted code that can be executed on the on-demand code execution system; identifying a processor instruction set associated with the user-submitted code, wherein the user-submitted code utilizes the processor instruction set when executed on the on-demand code execution system; and In response to a request to execute the user-submitted code: obtaining information regarding availability of a physical processor that implements the processor instruction set; Obtaining first performance information about the physical processor; obtaining second performance information about a virtual processor that implements the processor instruction set; determining a recommended processor for executing the user-submitted code based at least in part on the availability information, the first performance information, and the second performance information; as well as The on-demand code execution system is caused to execute the user-submitted code on the recommended processor.
6. The computer-implemented method of claim 5, wherein at least one of the first performance information and the second performance information was generated during a previous execution of the user-submitted code on the on-demand code execution system.
7. The computer-implemented method of claim 5, further comprising: obtaining, from the on-demand code execution system, performance metrics regarding execution of the user-submitted code using the selected computing resources; identifying an alternative computing resource based at least in part on the performance metric; as well as An updated recommendation including the alternative computing resource is provided to the on-demand code execution system, wherein providing the updated recommendation causes the on-demand code execution system to migrate execution of the user-submitted code to a different computing resource.
8. The computer-implemented method of claim 5, wherein the first computing resource is a physical computing resource and the second computing resource is a virtual computing resource.
9. The computer-implemented method of claim 5, further comprising identifying a first computing resource and a second computing resource based at least in part on functionality associated with executing the user-submitted code.
10. The computer-implemented method of claim 5, further comprising aggregating a plurality of previous recommendations for computing resources to determine a recommended hardware configuration for the on-demand code execution system.
11. The computer-implemented method of claim 10, wherein the recommended hardware configuration is based at least in part on one or more of: performance measures; or One or more trends among the plurality of previous recommendations.
12. The computer-implemented method of claim 5, wherein the first computing resource implements the functionality by emulating the functionality.
13. A non-transitory computer-readable medium comprising computer-executable instructions that, when executed by an on-demand code execution system, cause the on-demand code execution system to: receiving user-submitted code that can be executed on the on-demand code execution system; identifying a processor instruction set associated with the user-submitted code, wherein the user-submitted code utilizes the processor instruction set when executed on the on-demand code execution system; and In response to a request to execute the user-submitted code: obtaining information regarding availability of a physical processor that implements the processor instruction set; Obtaining first performance information about the physical processor; obtaining second performance information about a virtual processor that implements the processor instruction set; determining a recommended processor for executing the user-submitted code based at least in part on the availability information, the first performance information, and the second performance information; as well as The on-demand code execution system is caused to execute the user-submitted code on the recommended processor.
14. The non-transitory computer-readable medium of claim 13, comprising other computer-executable instructions that, when executed by the on-demand code execution system, cause the on-demand code execution system to: generate a prioritized list of computing resources based at least in part on performance estimates of individual computing resources among a plurality of computing resources.
15. The non-transitory computer-readable medium of claim 13, comprising other computer-executable instructions that, when executed by the on-demand code execution system, cause the on-demand code execution system to perform the following operations: determine, based at least in part on a performance estimate of an unavailable computing resource, to migrate at least one other task to make the unavailable computing resource available.
