From 23fa36e0c771d4a9717eb30a3417c7b820056556 Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 2 Feb 2024 15:06:42 +0000 Subject: [PATCH] Improve cold starts on AL2023 Improve cold start performance for .NET 8 when HTTP requests are made on Amazon Linux 2023. See https://github.com/aws/aws-lambda-dotnet/pull/1661. --- .gitignore | 3 +-- s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/Dockerfile | 1 + .../src/aws-lambda-tools-defaults.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 54cf9acf0e..4e3a9022af 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,7 @@ container-uploader/*.zip s3-uploader/node_modules s3-uploader/runtimes/rust_on_provided_al2/target s3-uploader/runtimes/rust_on_provided_al2023/target -s3-uploader/runtimes/dotnetcore31/src/obj -s3-uploader/runtimes/dotnet6/src/obj +s3-uploader/runtimes/dotnet*/src/obj s3-uploader/runtimes/java21/.gradle s3-uploader/runtimes/java21/build s3-uploader/runtimes/java21/bin diff --git a/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/Dockerfile b/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/Dockerfile index d4661a3724..4fe80e0a53 100644 --- a/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/Dockerfile +++ b/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/Dockerfile @@ -6,6 +6,7 @@ COPY src . RUN yum update -y && yum install -y clang zlib-devel krb5-devel openssl-devel zip gzip tar wget RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && chmod +x ./dotnet-install.sh && ./dotnet-install.sh --version latest ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 +ENV SSL_CERT_FILE=/tmp/noop RUN /root/.dotnet/dotnet publish --configuration Release --arch $ARCH --output /tmp/publish RUN zip -j /tmp/code.zip /tmp/publish/bootstrap diff --git a/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json b/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json index c73c187aad..1d9ab04e10 100644 --- a/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json +++ b/s3-uploader/runtimes/dotnet8_aot_on_provided_al2023/src/aws-lambda-tools-defaults.json @@ -1,5 +1,6 @@ { "configuration": "Release", + "environment-variables" : "SSL_CERT_FILE=/tmp/noop", "framework": "net8.0", "function-runtime": "provided.al2023", "function-memory-size": 256,