Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

AWS Lambda

From Wikipedia, the free encyclopedia
Serverless computing platform
AWS Lambda
Developer(s)Amazon.com
Initial releaseNovember 13, 2014; 10 years ago (2014-11-13)
Operating systemCross-platform
Available inEnglish
Websiteaws.amazon.com/lambda Edit this on Wikidata

AWS Lambda is anevent-driven,serverlessFunction as a Service (FaaS) provided byAmazon as a part ofAmazon Web Services. It is designed to enable developers to run code without provisioning or managing servers. It executes code in response toevents and automatically manages the computing resources required by that code. It was introduced on November 13, 2014.[1]

Specification

[edit]

Each AWS Lambda instance runs within a lightweight, isolated environment powered byFirecracker microVMs. These microVMs are initialized with a runtime environment based onAmazon Linux (Amazon Linux AMI or Amazon Linux 2), a custom Linux distribution developed by AWS. Firecracker provides hardware-virtualization-based isolation, aiming to achieve near-bare-metal performance with minimal overhead. AWS claims that, unlike traditional virtual machines, these microVMs launch in milliseconds, enabling rapid and secure function execution with a minimal memory footprint. The Amazon Linux AMI is specifically optimized for cloud-native and serverless workloads, aiming to provide a lightweight, secure, and performant runtime environment.[2][3][4]

As of 2025[update], AWS Lambda supportsNode.js,Python,Java,Go,.NET,Ruby and custom runtimes.[5]

Cold Start Performance and Deployment Considerations

[edit]

Rust and Go generally exhibit lower cold start times in AWS Lambda compared to Java and C#[6]because they compile to native static binaries, eliminating the need for a virtual machine (JVM or .NET CLR) and reducing runtime initialization overhead. Go has some minimal runtime initialization, including garbage collection and goroutine management, but its impact on cold start time is relatively low. Rust, which is fully ahead-of-time (AOT) compiled and does not require a runtime, often achieves the lowest cold start latency among supported languages.[7][8][9][10][11][12]

Java and C# run on managed runtime environments, introducing additional cold start latency due to runtime initialization and Just-In-Time (JIT) compilation. However, modern optimizations have mitigated some of these challenges. .NET 7 and .NET 8 support Ahead-of-Time (AOT) compilation, reducing cold start times by precompiling code.[13][14] Additionally, AWS Lambda SnapStart for Java 11 and 17 pre-warms and snapshots execution state, significantly decreasing cold start overhead for Java-based functions.[15][16] Despite these optimizations, Rust and Go typically maintain lower cold start times due to their minimal runtime dependencies.[7][8]

In long-running workloads, JIT compilation in Java and .NET may improve execution speed through dynamic optimizations. However, this benefit is workload-dependent, and Rust’s AOT compilation often provides better performance consistency, particularly for CPU-bound tasks.[17] For short-lived Lambda invocations, Rust and Go generally maintain more predictable performance, as JIT optimizations may not have sufficient time to take effect.[8][18]

Historically, Rust and Go required additional effort in deployment due to cross-compilation and static linking challenges. Rust, in particular, often necessitates MUSL-based static linking for AWS Lambda compatibility. However, advancements in deployment tooling, including AWS Serverless Application Model (AWS SAM), GitHub Actions, and Lambda container images, have simplified this process. Go benefits from native static linking support, making its deployment process comparatively straightforward. AWS Lambda's support for container images further reduces runtime compatibility concerns, enabling the use of custom runtimes and dependencies.[7][8][19][20][21][22]

Features

[edit]

In 2019, at the AWS annual cloud computing conference (AWS re:Invent), the AWS Lambda team announced "Provisioned Concurrency", a feature that "keeps functions initialized and hyper-ready to respond in double-digit milliseconds."[23] The Lambda team described Provisioned Concurrency as "ideal for implementing interactive services, such as web and mobile backends, latency-sensitivemicroservices, or synchronous APIs."[24]

The Lambda Function URL gives Lambda a unique and permanentURL which can be accessed byauthenticated and non-authenticated users alike.[25]

Lambda layer

[edit]

AWS Lambda layer is a ZIP archive containing libraries, frameworks or custom code that can be added to AWS Lambda functions.[26] As of December 2024, AWS Lambda layers have significant limitations:[8][27]

  • No semantic versioning support.
  • Incompatibility with major security scanning tools.
  • Contribution to Lambda's 250MB size limit.
  • Impeded local testing.
  • Notree-shaking optimizations.

Portability

[edit]

Migration from AWS Lambda to other AWS compute services, such as Amazon ECS, presents challenges due to tight integration with AWS Lambda's APIs, often referred to as service lock-in.[28][29] Tools like AWS Lambda Web Adapter offer a pathway forportability by enabling developers to build web applications using familiar frameworks under a monolithic Lambda design pattern.[28][29] However, this approach introduces limitations, including coarser-grained alerting and access controls, potential cold start delays with large dependencies, and limited suitability for non-HTTP APIs.[8]

Tools

[edit]

AWS Lambda Powertools is an open-source library developed by AWS that provides utilities for observability, tracing, and logging in AWS Lambda functions.[30] It includes structured logging, metrics, and tracing tools for Python, Java, and TypeScript. As of March 2025, it also includes data masking support for Python.[31][32]

Threading and Scalability in AWS Lambda

[edit]

As of March 2025, AWS Lambda supports limited vertical scaling by increasing the number of virtual central processing units (vCPUs) through memory allocation. However, it does not allow an increase in single-thread performance, as clock speed remains fixed. When a function is allocated only one vCPU, multiple threads share the same core, resulting in context switching rather than true parallel execution. As a result, multi-threading in single-vCPU environments is primarily beneficial for input/output (I/O)-bound workloads rather than computationally intensive tasks.[33][34][35][36][37]

Allocating additional memory in AWS Lambda enables multiple vCPUs, allowing for parallel execution. However, the clock speed per core remains unchanged, limiting individual thread performance. This configuration makes AWS Lambda suitable for workloads that scale horizontally or leverage parallelism but less optimal for applications that require high single-thread performance.[33][34][35][36][37]

Security

[edit]

In April 2022, researchers found cryptomining malware targeting AWS Lambda named "Denonia".[38][39][40]

See also

[edit]

References

[edit]
  1. ^Serverless Development on AWS Building Enterprise-Scale Serverless Solutions. O'Reilly Media. 23 January 2024.ISBN 9781098141899.
  2. ^Spigolon, Manuel; Sinik, Maksim; Collina, Matteo (9 June 2023).Accelerating Server-Side Development with Fastify: A comprehensive guide to API development for building a scalable backend for your web apps. Packt Publishing.ISBN 9781800568747.
  3. ^"Firecracker – Lightweight Virtualization for Serverless Computing".
  4. ^"Secure and fast microVMs for serverless computing".
  5. ^"Lambda runtimes".
  6. ^"Optimizing AWS Lambda extensions in C# and Rust | AWS Compute Blog".aws.amazon.com. 2023-04-13. Retrieved2025-03-20.
  7. ^abcChapin, John; Roberts, Mike (2020).Programming AWS Lambda: build and deploy serverless applications with Java. Beijing Boston Farnham Sebastopol Tokyo: O'Reilly.ISBN 978-1-4920-4102-3.
  8. ^abcdefCui, Yan (17 April 2017).Serverless Architectures on AWS: With examples using AWS Lambda. Simon and Schuster.ISBN 9781638351146.
  9. ^"Operating Lambda: Performance optimization – Part 1 | AWS Compute Blog".aws.amazon.com. 2021-04-26. Retrieved2025-03-20.
  10. ^"Understanding the Lambda execution environment lifecycle - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  11. ^"Define Lambda function handler in Rust - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  12. ^"Define Lambda function handlers in Go - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  13. ^"Building .NET Lambda functions with Native AOT compilation in AWS SAM - AWS Serverless Application Model".docs.aws.amazon.com. Retrieved2025-03-20.
  14. ^"Introducing the .NET 8 runtime for AWS Lambda | AWS Compute Blog".aws.amazon.com. 2024-02-22. Retrieved2025-03-20.
  15. ^"Reducing Java cold starts on AWS Lambda functions with SnapStart | AWS Compute Blog".aws.amazon.com. 2022-11-29. Retrieved2025-03-20.
  16. ^"Improving startup performance with Lambda SnapStart - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  17. ^"Compile .NET Lambda function code to a native runtime format - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  18. ^"Customize Java runtime startup behavior for Lambda functions - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  19. ^"Building Lambda functions with Rust - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-20.
  20. ^"Building Rust Lambda functions with Cargo Lambda in AWS SAM - AWS Serverless Application Model".docs.aws.amazon.com. Retrieved2025-03-20.
  21. ^"Generate a starter CI/CD pipeline with AWS SAM - AWS Serverless Application Model".docs.aws.amazon.com. Retrieved2025-03-20.
  22. ^"Migrating AWS Lambda functions to Arm-based AWS Graviton2 processors | AWS Compute Blog".aws.amazon.com. 2022-01-24. Retrieved2025-03-20.
  23. ^"New – Provisioned Concurrency for Lambda Functions".aws.amazon.com. 3 December 2019.Archived from the original on 2020-10-18. Retrieved2020-10-12.
  24. ^"New – Provisioned Concurrency for Lambda Functions".Amazon Web Services. 2019-12-03.Archived from the original on 2020-02-03. Retrieved2020-02-03.
  25. ^"Lambda function URLs - AWS Lambda".docs.aws.amazon.com.Archived from the original on 2024-03-01. Retrieved2024-03-01.
  26. ^"Managing Lambda dependencies with layers".Archived from the original on 2024-02-04. Retrieved2024-02-02.
  27. ^Eagar, Gareth (29 December 2021).Data Engineering with AWS: Learn how to design and build cloud-based data transformation pipelines using AWS. Packt Publishing.ISBN 9781800569041.
  28. ^ab"AWS Lambda Web Adapter".GitHub.Archived from the original on 2024-11-28. Retrieved2024-11-29.
  29. ^ab"The Lambda monolith".Archived from the original on 2024-11-26. Retrieved2024-11-29.
  30. ^"Simplifying serverless best practices with Lambda Powertools | AWS Open Source Blog".aws.amazon.com. 2020-06-22. Retrieved2025-03-22.
  31. ^"Homepage - Powertools for AWS Lambda (Python)".docs.powertools.aws.dev. Retrieved2025-03-22.
  32. ^"Data Masking - Powertools for AWS Lambda (Python)".docs.powertools.aws.dev. Retrieved2025-03-22.
  33. ^ab"Configure Lambda function memory - AWS Lambda".docs.aws.amazon.com. Retrieved2025-03-18.
  34. ^ab"Efficiently processing batched data using parallelization in AWS Lambda | AWS Compute Blog".aws.amazon.com. 2024-08-28. Retrieved2025-03-18.
  35. ^ab"Parallel Processing in Python with AWS Lambda | AWS Compute Blog".aws.amazon.com. 2017-09-11. Retrieved2025-03-18.
  36. ^ab"AWS Lambda now supports up to 10 GB of memory and 6 vCPU cores for Lambda Functions".Amazon Web Services, Inc. Retrieved2025-03-18.
  37. ^ab"Operating Lambda: Application design – Scaling and concurrency: Part 2 | AWS Compute Blog".aws.amazon.com. 2021-02-08. Retrieved2025-03-18.
  38. ^"Cado Discovers Denonia: The First Malware Specifically Targeting Lambda".Archived from the original on 2024-11-15. Retrieved2024-11-04.
  39. ^"New cryptocurrency mining malware used to target AWS Lambda: Researchers | Technology News - the Indian Express".Archived from the original on 2024-03-15. Retrieved2024-11-04.
  40. ^"Researcher finds cryptomining malware targeting AWS Lambda".Archived from the original on 2024-04-05. Retrieved2024-11-04.

External links

[edit]
People
Current
Former
Facilities
Products and
services
Subsidiaries
Cloud
computing
Services
Devices
Technology
Media
Retail
Logistics
Former
Litigation
Other
Unions
Retrieved from "https://en.wikipedia.org/w/index.php?title=AWS_Lambda&oldid=1281710675"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp