Skip to content

Commit

Permalink
Remove net core 3.1, Lambda out of support
Browse files Browse the repository at this point in the history
  • Loading branch information
jeastham1993 committed Nov 10, 2023
1 parent e6afae2 commit 8c7e301
Show file tree
Hide file tree
Showing 41 changed files with 23 additions and 1,877 deletions.
80 changes: 23 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ The application consists of an [Amazon API Gateway](https://aws.amazon.com/api-g

It includes the below implementations as well as benchmarking results for both x86 and ARM64:

- .NET Core 3.1
- .NET Core 3.1 with Open Telemetry tracing
- .NET 6 Lambda
- .NET 6 Top Level statements
- .NET 6 Minimal API
Expand All @@ -39,7 +37,7 @@ There are four implementations included in the repository, covering a variety of

There is a separate project for each of the four Lambda functions, as well as a shared library that contains the data access implementations. It uses the hexagonal architecture pattern to decouple the entry points, from the main domain and storage logic.

### .NET 6
## .NET 6

This implementation is the simplest route to upgrade a .NET Core 3.1 function to use .NET 6 as it only requires upgrading the function runtime, project target framework and any dependencies as per the final section of [this link](https://aws.amazon.com/blogs/compute/introducing-the-net-6-runtime-for-aws-lambda/).

Expand All @@ -65,6 +63,8 @@ The code is compiled natively for either Linux-x86_64 or Linux-ARM64 and then de

Details for compiling .NET 6 native AOT can be found [here](https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/compiling.md)

## .NET 7

### .NET 7 Custom Runtime

The code is compiled on a custom runtime and deployed to the provided.al2 Lambda runtime because Lambda doesn't have a .NET 7 runtime. The code is compiled as ReadyToRun and Self-Contained because there is not .NET runtime on provided.al2 to depend on. This type of deployment is expected to be slower than a fully supported Lambda runtime like .NET 6. This sample should be able to be tested with `sam build` and then `sam deploy --guided`.
Expand All @@ -81,6 +81,24 @@ There is a single project named ApiBootstrap that contains all the start-up code

Details for compiling .NET 7 native AOT can be found [here](https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/compiling.md)

## .NET 8

### .NET 8 Custom Runtime

The code is compiled on a custom runtime and deployed to the provided.al2 Lambda runtime because Lambda doesn't have a .NET 8 runtime. The code is compiled as ReadyToRun and Self-Contained because there is not .NET runtime on provided.al2 to depend on. This type of deployment is expected to be slower than a fully supported Lambda runtime like .NET 6. This sample should be able to be tested with `sam build` and then `sam deploy --guided`.

### .NET 8 native AOT

The code is compiled natively for Linux-x86_64 then deployed manually to Lambda as a zip file.

Details for compiling .NET 7 native AOT can be found [here](https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/compiling.md)

### .NET 8 minimal API with native AOT

There is a single project named ApiBootstrap that contains all the start-up code and API endpoint mapping. The code is compiled natively for Linux-x86_64 then deployed manually to Lambda as a zip file. Microsoft have announced limited support for ASP.NET and native AOT in .NET 8, using the `WebApplication.CreateSlimBuilder(args);` method.

Details for compiling .NET 8 native AOT can be found [here](https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/compiling.md)

## Deployment

To deploy the architecture into your AWS account, navigate into the respective folder under the src folder and run 'sam deploy --guided'. This will launch a deployment wizard, complete the required values to initiate the deployment. For example, for .NET 6:
Expand Down Expand Up @@ -111,6 +129,8 @@ All latencies listed below are in milliseconds.

[AWS Lambda Power Tuning](https://github.com/alexcasalboni/aws-lambda-power-tuning) is used to optimize the cost/performance. 1024MB of function memory provided the optimal balance between cost and performance.

For the .NET 8 Native AOT compiled example the optimal memory allocation was 3008mb.

![](./imgs/power-tuning.PNG)

### Results
Expand All @@ -123,60 +143,6 @@ filter @type="REPORT"
| stats count(*) as count, pct(duration, 50) as p50, pct(duration, 90) as p90, pct(duration, 99) as p99, max(duration) as max by coldstart
```

### .NET Core 3.1

<table class="table-bordered">
<tr>
<th colspan="1" style="horizontal-align : middle;text-align:center;"></th>
<th colspan="4" style="horizontal-align : middle;text-align:center;">Cold Start (ms)</th>
<th colspan="4" style="horizontal-align : middle;text-align:center;">Warm Start (ms)</th>
</tr>
<tr>
<th></th>
<th scope="col">p50</th>
<th scope="col">p90</th>
<th scope="col">p99</th>
<th scope="col">max</th>
<th scope="col">p50</th>
<th scope="col">p90</th>
<th scope="col">p99</th>
<th scope="col">max</th>
</tr>
<tr>
<th>ARM64</th>
<td>1122.70</td>
<td>1170.83</td>
<td>1225.92</td>
<td>1326.32</td>
<td><b style="color: green">5.55</b></td>
<td><b style="color: green">8.74</b></td>
<td><b style="color: green">19.85</b></td>
<td>256.55</td>
</tr>
<tr>
<th>X86</th>
<td>1004.80</td>
<td>1135.81</td>
<td>1422.78</td>
<td>1786.78</td>
<td><b style="color: green">6.11</b></td>
<td><b style="color: green">10.82</b></td>
<td><b style="color: green">29.40</b></td>
<td>247.32</td>
</tr>
<tr>
<th>X86 with Open Telemetry</th>
<td>1615.31</td>
<td>1704.93</td>
<td>1931.82</td>
<td>2067.97</td>
<td><b style="color: green">7.04</b></td>
<td><b style="color: green">12.08</b></td>
<td><b style="color: green">35.57</b></td>
<td>1059.78</td>
</tr>
</table>

### .NET 6

<table class="table-bordered">
Expand Down
18 changes: 0 additions & 18 deletions src/NET31-OTel/DeleteProduct/DeleteProduct.csproj

This file was deleted.

80 changes: 0 additions & 80 deletions src/NET31-OTel/DeleteProduct/Function.cs

This file was deleted.

13 changes: 0 additions & 13 deletions src/NET31-OTel/GenerateLoadTestResults/DateUtils.cs

This file was deleted.

146 changes: 0 additions & 146 deletions src/NET31-OTel/GenerateLoadTestResults/Function.cs

This file was deleted.

Loading

0 comments on commit 8c7e301

Please sign in to comment.