aws / aws/aws-lambda-rust-runtime

Consider documenting AWS_LC_SYS_NO_JITTER_ENTROPY

未关闭
#1,101 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.6k
派生
396
PR 合并指标
30 天内没有已合并 PR

描述

Context: https://github.com/aws/aws-lc-rs/issues/899

Docs: https://aws.github.io/aws-lc-rs/resources.html#entropy-configuration

Recent versions of `AWS_LC` enable a new entropy source, CPU jitter, which is somewhat expensive to initialize. It adds ~50ms of latency to startup in their testing, though I've seen signs of a decent amount higher on small instance sizes. CPU jitter is enabled by default, but can be opted out of.

Since lambdas are frequently cold-start latency sensitive, this might be relevant to our userbase. For context, java lambdas using snapstart, have it disabled by default, based on a built in AWS LC check.

We don't directly use AWS_LC, but it is widely used by lambda applications as aws-sdks default to using it as the TLS backend (along with reqwest and much of the rest of the async ecosystem). So, we can expect most lambdas to be impacted by this behavior.

The workaround is to inject an environment variable via eg your `.cargo/config.toml`:
```
[env]
AWS_LC_SYS_NO_JITTER_ENTROPY=1
```

The implication of disabling this is, you would only have 1-2 other entropy sources (OS source + CPU source). CPU source availability varies based on environment. You generally want >= 2 entropy sources, hence the new default.

However, on casual examination, I think pretty much any hardware that aws lambda runs on, should anyway have cpu source? (I have not looked deeply though, some might not, this needs more research).

It seems like this is something our users would appreciate knowing about. Not sure exactly where though. Perhaps it belongs in the aws-side lambda docs instead?

贡献指南

打开贡献指南

调研方向

先查看链接的 AWS LC issue 和资源文档中的熵配置部分,然后确定这些指导是否应归入 Lambda 文档。记录 AWS_LC_SYS_NO_JITTER_ENTROPY workaround、其与冷启动相关的动机以及熵源之间的权衡;应包含相应的 .cargo/config.toml 示例。

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, rust
领域
cloud, documentation
Issue 类型
文档
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。