Performance test for Azure Function and AWS Lambda
Recently I got a mission to compare the difference between two serverless services: Azure Function and AWS Lambda. Except comparing the deploying methods, supporting services and computing resources they provide. I also did a simple performance test on both.
Experiments
I created two serverless services which response HTTP 200 when receiving requests. Both services are located near Tokyo (Japan East for Azure and Tokyo for AWS).
For Azure Function, I used HTTP Triggered function written in Node.js on windows machine because Azure doesn’t support Linux machine in Japan East when I did the experiment. The whole infrastructure can be easily done by Azure Core or VS code with Azure Function plugin.
The Node.js code looks like this:
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
context.res = {
body: "Hello from Azure!!!"
}
};
The HTTP trigger endpoint for Azure Function can be found in Azure web console under “Function App Service -> Functions -> YourHttpTrigger” as below:

For AWS Lambda, I created a Lambda function written in Node.js 10.x and connect it with an Application Load Balancer to HTTP requests.
The Node.js code looks like this:
exports.handler = async (event) => {
const response = {
statusCode: 200,
body: JSON.stringify('Hello from AWS!!!'),
};
return response;
};
I added an Application Load Balancer with target group set to the Lambda I just created. This step can be easily done from AWS Lambda web console.
The DNS name of ALB for sending HTTP requests can be found in the AWS web console under “VPC” -> “Load balancer” -> “Description” shown as below:

After all the services are ready, I use the collections function of Postman to send HTTP requests to both endpoints from Taipei office in my company. I sent 3000 requests in total and the sending frequency is 10ms.
Results
The response time statistic of both services is as shown below:



Observations
From the result graph, Azure Function has shorter response time on average, but AWS Lambda has more stable response time (lower variance). However, the experiment result may be affected by other factors.
Thanks for reading and feel free to share your thoughts.