Serverless functions enable developers to run code without having to manage a server. This allows them to focus on writing and deploying applications, while infrastructure scaling and maintenance are handled automatically in the background.
1.

Integration with Azure services
2.

3.

AI and blockchain applications
4.

5.

6.

In this benchmark, we evaluated 6 popular platforms following our methodology to test their serverless function performance. We measured their fastest and slowest response times, total execution time for 1000 requests, throughput, and the average time per successful request under load.
Results
Fastest Time: The left end of each bar represents the minimum response time, indicating how quickly the platform can process the requests under optimal conditions.
Slowest Time: The right end of each bar shows the slowest response time, representing the maximum latency or the longest time taken to process a request.
Requests/sec: The number of requests per second, i.e., the average throughput. This measures the server’s processing capacity. Higher is better because it means more requests can be processed per second.
Total Time: Lower is better because the platform can quickly handle the workload.
Average Time per Successful Request: The average time per request for successfully processed requests, excluding any errors or failed requests. Lower is better, indicating faster processing for each request.
Microsoft Azure Functions
Microsoft Azure Functions is a serverless computing service that enables developers to build and deploy event-driven applications without managing infrastructure. It provides robust integration with other Azure services, such as Azure Blob Storage for file handling, Cosmos DB for database operations, and Event Grid for event routing, facilitating seamless data processing and workflow automation. It features automatic scaling to manage varying request volumes and integrates with Azure Monitor and Azure Security Center for detailed performance tracking and security management.

AWS Lambda Functions
AWS Lambda is a serverless computing service offered by Amazon Web Services (AWS) that allows developers to run code in response to events without managing servers. Lambda integrates with other AWS services, such as Amazon S3 for storage, DynamoDB for database operations, and API Gateway for HTTP endpoints, enabling the development of comprehensive event-driven architectures. Additionally, AWS Step Functions can coordinate multiple Lambda functions, supporting the creation of complex workflows for tasks like data processing or application orchestration.

Cloudflare Workers
With Cloudflare Workers, developers can run their code in data centers worldwide, achieving low latency. The platform supports technologies such as JavaScript and WebAssembly, allowing developers to deploy their applications quickly. Cloudflare Workers is also optimized for AI and blockchain applications.
Cloudflare Workers is focused on edge computing and high performance with low latency. Developers can evaluate these platforms according to their needs and project requirements.

Google Cloud Functions
Google Cloud Functions is a serverless execution environment that allows developers to run code triggered by events from sources such as HTTP requests, Cloud Storage updates, or Pub/Sub messages. The platform scales automatically to handle fluctuating workloads, provisioning resources as needed without manual intervention. Google Cloud Functions also integrates with Google Cloud’s data and analytics services, such as BigQuery for large-scale data analysis and Cloud Dataflow for stream processing, supporting applications focused on data handling and real-time insights. Its event-driven design ensures efficient execution of tasks tied to specific triggers within the Google Cloud ecosystem.

Huawei Cloud FunctionGraph
Huawei Cloud FunctionGraph is a serverless computing service that enables developers to execute code in response to events without managing server infrastructure. The service integrates with event sources within the Huawei Cloud ecosystem, including Object Storage Service (OSS) for file-related triggers and API Gateway for HTTP-based invocations, allowing the creation of event-driven applications. Huawei Cloud FunctionGraph provides automatic scaling to adapt to workload changes and operates on a pay-per-use billing model, charging only for the resources consumed during execution. It also includes monitoring and logging capabilities through Huawei Cloud’s observability tools, assisting developers in tracking performance and diagnosing issues in their applications.

Heroku
Heroku is a Platform as a Service (PaaS) that allows rapid application deployment and management. It uses virtual containers called “dynos” to facilitate application management and scaling. Additionally, it offers temporary “one-off dynos” for executing specific operations in a serverless function manner.

Supported language count
Service | Number of Languages | Languages Supported |
---|---|---|
What are serverless functions?
Serverless functions, also known as Function as a Service (FaaS), are a cloud computing model that allows developers to execute code without the need to manage underlying servers or infrastructure. In this approach, developers write small, event-driven pieces of code (functions) that are triggered by specific events, such as an HTTP request, a database update, or a message in a queue. The cloud provider automatically handles the server provisioning, scaling, and management, freeing developers to focus solely on writing and deploying their code.
In serverless architectures, resources are dynamically scaled according to real-time demand. During periods of inactivity, the infrastructure automatically scales down to zero, eliminating resource consumption and associated costs. On the other hand, when demand surges, the system rapidly scales up to handle increased workloads. This dynamic scalability ensures optimized cost-effectiveness, as billing is based on the actual computing resources used.
How do serverless functions work?
1. Event Trigger:
Serverless functions are event-driven, triggering by HTTP requests, file uploads, database changes, or other events. The event defines when the function should be executed.
2. Execution:
Once an event is triggered, the cloud provider provisions a lightweight environment to run the function. This is often called a “container” or “execution environment.” The code is executed within this environment, but the environment is temporary and created just for the duration of the function’s execution.
3. Scaling:
Serverless platforms are designed to scale automatically based on demand. If multiple events happen simultaneously, the platform will spin up more instances of the function to handle them, often called horizontal scaling. The cloud provider handles this automatically, so you don’t need to manage the infrastructure yourself.
4. Shutdown:
Once the function has finished executing, the environment (container) is shut down. The serverless function doesn’t run or consume resources after completing its task.
Benefits of serverless functions
No server management
With serverless functions, developers don’t need to worry about provisioning, managing, or maintaining the underlying infrastructure. The cloud provider handles server management, such as patching, scaling, and monitoring, allowing developers to focus on writing and deploying the business logic. This abstracts away the complexity of managing servers, operating systems, or hardware, resulting in fewer operational headaches for development teams.
For example, with AWS Lambda, developers can deploy their functions without managing virtual machines, load balancers, or networking components. The platform automatically provisions the resources needed to execute the function in response to an event, ensuring execution without manual intervention.
Cost efficiency
Serverless functions are typically billed based on the actual usage of resources, not pre-allocated computing power or idle time. This pay-as-you-go model allows businesses to only pay for the time their code runs, often measured at a very granular level (e.g., per millisecond or per function invocation). This contrasts traditional cloud computing models where you may pay for reserved computing power even when it’s unused.
For instance, you don’t pay for unused capacity if your function is idle or receiving low traffic. On the other hand, when demand spikes, the platform dynamically adjusts resources to meet the load, without extra cost beyond the actual usage. This makes serverless computing a highly cost-effective option, particularly for workloads with variable traffic patterns.
Automatic scaling
One of the most powerful features of serverless functions is their ability to scale automatically in response to demand. When many events trigger functions simultaneously, the platform automatically provisions additional resources (such as new instances of the function) to handle the increased load. Once the demand subsides, the system scales down resources, ensuring that only the necessary infrastructure is being used.
For example, during high-traffic events like product launches or flash sales, a serverless platform such as AWS Lambda or Azure Functions will spin up additional resources to handle the increased request volume. After the event ends, the platform will scale back down to save resources and reduce costs.
Rapid deployment
Serverless functions can be deployed much faster than traditional applications, especially when integrating with other services. This is because you only need to write small, discrete units of code (functions) that are triggered by specific events. Deployment often involves simply uploading the function code to the platform, and the system takes care of everything from provisioning resources to managing runtime environments.
The rapid deployment feature is crucial for speeding up development cycles. Developers can experiment and iterate more quickly, as they don’t need to spend time setting up infrastructure or managing complex deployment pipelines. This can significantly reduce the time it takes to release new features or fix bugs, fostering a more agile development process. For example, you can quickly deploy a function that reacts to a file upload in a storage service or an API request without the overhead of managing the infrastructure yourself.
Methodology
In this benchmark, we developed a function that checks whether a site visitor’s browser is up to date based on the current operating system and user agent. The goal was to assess each platform’s performance in handling this type of request, which involves checking multiple user agents for browser updates.
Testing Procedure:
- Code Implementation: A Python function was created to inspect a visitor’s User Agent string. The function checks the current state of the operating system and compares it with the browser’s version to determine whether the browser is up-to-date. The code utilizes a simple comparison between the current version of the browser and the version supported by the operating system.
- Parallel Requests: The function was executed 1000 times in parallel, simulating real-world traffic, using 10 parallel threads to generate load. This setup tests the platforms’ ability to handle multiple simultaneous requests efficiently.
- Performance Metrics Collected: Several key performance metrics were recorded during the test to evaluate each platform’s efficiency and scalability.
FAQ
What is the difference between serverless and containerized functions?
Serverless functions are lightweight and run in a stateless environment, where the cloud provider handles the scaling and management of resources. In contrast, containerized functions package your code with all dependencies into a container that can run anywhere, allowing for more control over execution environments and scaling.
What is the difference between serverless and cloud functions?
Serverless functions, like AWS Lambda or Google Cloud Functions, are event-driven and scale automatically based on demand, without the need to manage infrastructure. Cloud functions refer to any cloud-based compute function but are typically associated with the serverless model where resources are dynamically provisioned.
How do AWS services and Google Cloud Functions compare for serverless applications?
Both AWS Lambda (AWS services) and Google Cloud Functions offer robust serverless environments. AWS Lambda integrates seamlessly with other AWS services, enabling easy connection between serverless functions and resources like S3 or DynamoDB. Google Cloud Functions, on the other hand, offers strong support for languages such as Go and Python, and is highly scalable for handling event-driven business logic. Your choice depends on your existing cloud ecosystem and the specific requirements of your serverless apps.
What are the benefits of using Azure Functions in serverless computing?
Azure Functions provides a powerful serverless platform with support for various languages, including C#, Java, JavaScript, and Python. It offers deep integration with other Azure services, such as Blob Storage and Cosmos DB, making it ideal for building connected, serverless applications. Additionally, Azure’s flexible functions runtime and auto-scaling capabilities allow efficient execution of business logic, providing both performance and cost efficiency in serverless environments.
How do I manage serverless apps on platforms like AWS Lambda or Cloudflare Workers?
Serverless apps on platforms like AWS Lambda and Cloudflare Workers allow developers to deploy functions with minimal overhead. AWS Lambda connects functions to other AWS services, while Cloudflare Workers focuses on low-latency execution through its edge computing model. Both platforms handle the scaling automatically based on traffic, so you don’t need to worry about infrastructure management. These platforms optimize the execution of your function code, improving the performance and scalability of your serverless applications.