Giter Club home page Giter Club logo

graal-kotlin-lambda's Introduction

graal-kotlin-lambda

The JVM-Runtime is notorious for it's long, multi-seconds coldstarts. Workarounds in the form of lambda warm up magic are rather ugly.

With the addition of native lambda runtimes, we can use graalvm to build a native image which should be significantly faster.

=>

The native lambda generated by this repo with a 256 MB lambda needs roughly 150 ms for a coldstart.

Also used tech: gradle + terraform

status

  • basic gradle setup
  • terraform ec2 (for build, graalvm only works on *nix)
  • graalvm task works
  • create http client for lambda runtime interface (http + json parsing)
  • implement lambda runtime interface
  • terraform lambda using graalvm image
  • replace manual ec2 build with codebuild from git repo and automatic lambda rollout

lambda creation

Currently, the lambda function gets created by terraform. On a clean slate (no state), the creation would fail because the expected zip won't be present inside the s3 bucket (no codebuild run yet). Therefore a fake zip will be used during the lambda creation. The codebuild job will call lambda:UpdateFunctionCode.

Alternatively, the codebuild job could also handle the creation of the function, if it is not yet created. Both approaches aren't without flaw.

links

tipps

  • compute_type = "BUILD_GENERAL1_SMALL" keeps crashing, possible because it needs more RAM -> BUILD_GENERAL1_MEDIUM
  • Maybe you forgot to apply terraform?!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.