Skip to content

An extremely small and fast AWS Lambda runtime with sub-5ms cold starts. Works with C and Rust. Named after its primary dependency: libc.

License

Notifications You must be signed in to change notification settings

simonsan-contrib/aws-lambda-libc-runtime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an ultra-slim, minimalistic custom runtime for AWS Lambda, with API bindings for C and Rust.

Features

  • No abstraction bloat: HTTP Headers and JSON payload delivered in a raw char* buffer
  • No dependencies outside of standard C library. Opt-in to whatever you actually need.
  • Dynamically linked to glibc on target al2023 image, to minimize binary size
  • No allocator dependency: Bring your own arena or gc allocator, or use malloc if you want
  • (Optional) Rust language binding with no_std, no_main and no#tokio
  • Rust binary is the same size as C binary (probably because of ELF page-boundary padding).

Benefits

  • Extremely small deployment package size (~5kb zipped)!
  • Extremely fast cold starts (4 to 5 milliseconds)
  • Minimizes waste of compute resources, slowing down Global Warming!

Alternatives

Project Structure

  • src/: The C source code which includes the runtime and an example function
  • tests/: Unit-integration test using a mock server in Python to emulate the AWS Lambda Environment locally.
  • sam-deploy/: Scripts for building & deploying using AWS SAM CLI in Docker. This is optional, you could alternatively use CDK, Terraform, the plain AWS CLI, etc.
  • rust-binding/ & rust-example/: experimental Rust integration

Getting Started

Pre-requisites

git clone 
aws configure

C

python sam-deploy/deploy.py

Rust

python rust-example/build-test-deploy.py

About

An extremely small and fast AWS Lambda runtime with sub-5ms cold starts. Works with C and Rust. Named after its primary dependency: libc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 51.7%
  • Python 20.4%
  • Rust 17.5%
  • Dockerfile 10.4%