AWS Lambda Performance comparison

Overview
Comments
  • Optimize NodeJS function warm starts by enabling TCP connection reuse

    Optimize NodeJS function warm starts by enabling TCP connection reuse

    The AWS SDK variant that is available by default on Lambda runtime's is v2. This version creates and closes a new TCP connection for each network request. For backwards compatibility reasons, they didn't change that default behavior in v2, but they did in v3.

    However, this can be manually set in by passing in a configured http Agent to the AWS SDK with keepAlive set to true or by simply setting the AWS_NODEJS_CONNECTION_REUSE_ENABLED environment variable.

    While this shouldn't really impact cold starts much, the performance difference when measuring warm starts can be pretty significant. This is a relevant excerpt from the AWS documentation:

    By default, the default Node.js HTTP/HTTPS agent creates a new TCP connection for every new request. To avoid the cost of establishing a new connection, you can reuse an existing connection.

    For short-lived operations, such as DynamoDB queries, the latency overhead of setting up a TCP connection might be greater than the operation itself. Additionally, since DynamoDB encryption at rest is integrated with AWS KMS, you may experience latencies from the database having to re-establish new AWS KMS cache entries for each operation.

    opened by bilalq 5
  • You can make the Go lambda faster.

    You can make the Go lambda faster.

    If you compile the golang example with go build -tags lambda.norpc you can deploy the go version, without changes, to a "lambda custom runtime" and you will create a lambda that doesn't have amazon linux 2 in the image, making it smaller and faster to load.

    https://github.com/aws/aws-lambda-go/blob/main/lambda/entry.go#L64-L66

    opened by DavidJFelix 3
  • Suggest NodeJS TLS Connection Reuse in AWS SDK

    Suggest NodeJS TLS Connection Reuse in AWS SDK

    Nice to see others profiling runtimes.

    I ran into this issue with AWS Lambdas written in NodeJS being bizarrely slow a while back. It’s a legacy issue with how the AWS SDK for JavaScript works. If you have time, I suggest you try again with this one simple fix. I think you’ll be impressed.

    https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html

    opened by Artiavis 1
  • Make Rust Lambda Use Single-Threaded Runtime

    Make Rust Lambda Use Single-Threaded Runtime

    opened by miles-po 0
  • Use System.Text.Json as the Lambda serializer

    Use System.Text.Json as the Lambda serializer

    The previous PR https://github.com/Aleksandr-Filichkin/aws-lambda-runtimes-performance/pull/8 changed the usage of Newtonsoft to System.Text.Json in the actual Lambda function. This PR registers the System.Text.Json based Lambda serializer as the serializer for Lambda event and return objects.

    A big thing to help reduce .NET cold starts is remove all usages of Newtonsoft because loading that large assembly is very costly.

    opened by normj 0
  • Cold Start performance of Node.js runtime can be improved

    Cold Start performance of Node.js runtime can be improved

    Requiring aws-sdk package (which is AWS SDK V2) will load entire AWS Service Clients (e.g. CloudWatch, EC2, ECS, Kinesis, S3, ... etc.), not only DynamoDB Client.

    You will see better start-up performance if you load DynamoDB client only (e.g. const DynamoDB = require('aws-sdk/clients/dynamodb').

    Also, AWS Javascript SDK V3 is currently in GA. AWS Javascript SDK V3 is modular, and can be optimized using bundlers to eliminate dead codes, reducing its size, and also reduces startup-performance (Also it's faster than using individual service client!). See https://aws.amazon.com/ko/blogs/developer/modular-packages-in-aws-sdk-for-javascript/ for details.

    opened by mooyoul 0
  • Add or upgrade to Node 18

    Add or upgrade to Node 18

    AWS has launched their Node 18 runtime along with AWS SDK 3. It would be great to have some numbers on Node 18 performance, as it offers a lot of improvements over 14.x.

    https://aws.amazon.com/blogs/compute/node-js-18-x-runtime-now-available-in-aws-lambda/

    Thanks for this great project!

    opened by jSadoski 0
  • rust: amortize allocations

    rust: amortize allocations

    Use serde "zero-copy deserialisation" feature to reduce string allocations. The idea is to use a borrowed string &str instead of owned String. A borrowed string points to a already existing allocation (our request).

    opened by Anexen 0
Owner
Aleksandr Filichkin
Java expert, AWS fan
Aleksandr Filichkin
Automatic Dynamodb Capacity Change Lambda

DynamoDB Provisioned Capacity Adjuster This lambda function will adjust your AWS dynamodb write capacity on the fly. If you need to adjust the provisi

null 3 May 7, 2021
Java Collections till the last breadcrumb of memory and performance

Koloboke A family of projects around collections in Java (so far). The Koloboke Collections API A carefully designed extension of the Java Collections

Roman Leventov 967 Nov 14, 2022
High performance I/O library for Java using io_uring under the hood

nio_uring nio_uring is an I/O library for Java that uses io_uring under the hood, which aims to be: A simple and flexible API Super fast and efficient

Blake Beaupain 65 Dec 18, 2022
Quarkus JAX-RS App Deployed as AWS Lambda with AWS CDK

MicroProfile with Quarkus as AWS Lambda Function deployed with Cloud Development Kit (CDK) v2 for Java A lean starting point for building, testing and

Adam Bien 30 Dec 15, 2022
AWS JSON TRANSLATOR CLI is a command line application to translate JSON files using AWS Translate

A command line tool to translate JSON files using AWS Translate.

Marc Guillem 0 May 30, 2022
An example project showing how to enable tiered compilation on a Java AWS Lambda function.

AWS Lambda Tiered Compilation Sample Getting started Download or clone the repository. To install prerequisite software: Install AWS CDK Install Apach

AWS Samples 18 Dec 13, 2022
Roman Beskrovnyi 250 Jan 9, 2023
Roman Beskrovnyi 248 Dec 21, 2022
Comparison between Java and Common Lisp solutions to a phone-encoding problem described by Prechelt

Prechelt Phone Number Encoding This project implements the phone number encoding described by Lutz Prechelt in his article for the COMMUNICATIONS OF T

Renato Athaydes 27 Nov 30, 2021
Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: computing diffs

Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.

null 951 Jan 5, 2023
This repository contains the source code for a Product Comparison solution

Product Comparison Installation Guide This repository contains the source code for a Product Comparison solution. Please report any issues here. Insta

Mărgărit Marian Cătălin 8 Dec 5, 2022
Backport of Java 8's lambda expressions to Java 7, 6 and 5

Retrolambda: Use Lambdas on Java 7 Just as there was Retroweaver et al. for running Java 5 code with generics on Java 1.4, Retrolambda lets you run Ja

Esko Luontola 3.5k Dec 30, 2022
AWS Service registry for resilient mid-tier load balancing and failover.

Eureka Eureka is a REST (Representational State Transfer) based service that is primarily used in the AWS cloud for locating services for the purpose

Netflix, Inc. 11.6k Dec 30, 2022
Oryx 2: Lambda architecture on Apache Spark, Apache Kafka for real-time large scale machine learning

Oryx 2 is a realization of the lambda architecture built on Apache Spark and Apache Kafka, but with specialization for real-time large scale machine l

Oryx Project 1.8k Dec 28, 2022
Oryx 2: Lambda architecture on Apache Spark, Apache Kafka for real-time large scale machine learning

Oryx 2 is a realization of the lambda architecture built on Apache Spark and Apache Kafka, but with specialization for real-time large scale machine l

Oryx Project 1.7k Mar 12, 2021
Oryx 2: Lambda architecture on Apache Spark, Apache Kafka for real-time large scale machine learning

Oryx 2 is a realization of the lambda architecture built on Apache Spark and Apache Kafka, but with specialization for real-time large scale machine l

Oryx Project 1.8k Dec 28, 2022
Automatic Dynamodb Capacity Change Lambda

DynamoDB Provisioned Capacity Adjuster This lambda function will adjust your AWS dynamodb write capacity on the fly. If you need to adjust the provisi

null 3 May 7, 2021
backend for a sharing app using SpringBoot, Redis, MySQL, and AWS S3.

moments_v2_backend (Work In Progress) backend for a sharing app using SpringBoot, Redis, MySQL, and AWS S3. This is the second version of my project S

Haiming Sun 53 Dec 26, 2022
Trino connectors for managing cloud resources, like AWS EC2 instances or S3 buckets.

Trino connectors for managing cloud resources, like AWS EC2 instances or S3 buckets. Please keep in mind that this is not production ready and it was created for tests.

Jan Waś 11 Nov 4, 2022
AWS SaaS Boost

AWS SaaS Boost Overview AWS SaaS Boost provides organizations with ready-to-use core software elements for successfully running SaaS workloads in the

Amazon Web Services - Labs 839 Dec 27, 2022