Skip to content

Sample AWS Lambda application with GraalVM and AWS CRT client writing to Amazon DynamoDB

Notifications You must be signed in to change notification settings

maschnetwork/aws-lambda-graalvm-crt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Lambda Java GraalVM with AWS CRT client

Sample AWS Lambda application with GraalVM and AWS CRT client writing to Amazon DynamoDB.

Load test results

Loadtest Result

0.. warm start

1.. cold start (init duration + duration)

Prerequisites

  • AWS Account
  • Docker
  • AWS SAM CLI
  • Artillery for load testing

Setup

  1. Create the bundling image:
docker build -t al2023-graalvm:maven .
  1. Build the application via the bundling image:
sam build --build-image al2023-graalvm:maven --use-container
  1. Deploy the application
sam deploy ## --guided for the first run

Test the application

Get the API-Gateway Url:

 export API_GW_URL=$(aws cloudformation describe-stacks --stack-name <YOUR-STACK_NAME> | jq -r '.Stacks[0].Outputs[] | select(.OutputKey == "RequestHeaderGraalApi").OutputValue')

Do a sample request:

curl -XPOST "$API_GW_URL/request-headers-graal" --header 'Content-Type: application/json'

Run a load test

Run the test via:

artillery run -t $API_GW_URL  -v '{ "url": "/request-headers-graal" }' loadtest.yml

Retrieve results in Cloudwatch-Log insights via:

 filter @type = "REPORT"
    | parse @log /\d+:\/aws\/lambda\/(?<function>.*)/
    | stats
    count(*) as invocations,
    pct(@duration+coalesce(@initDuration,0), 0) as p0,
    pct(@duration+coalesce(@initDuration,0), 25) as p25,
    pct(@duration+coalesce(@initDuration,0), 50) as p50,
    pct(@duration+coalesce(@initDuration,0), 75) as p75,
    pct(@duration+coalesce(@initDuration,0), 90) as p90,
    pct(@duration+coalesce(@initDuration,0), 95) as p95,
    pct(@duration+coalesce(@initDuration,0), 99) as p99,
    pct(@duration+coalesce(@initDuration,0), 100) as p100
    group by function, ispresent(@initDuration) as coldstart
    | sort by coldstart, function

About

Sample AWS Lambda application with GraalVM and AWS CRT client writing to Amazon DynamoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published