Skip to content

Commit

Permalink
feat: aws ec2
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Dec 6, 2023
1 parent 9b11456 commit b186e7d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cloud-provider/aws/EC2/EBS 与 EBS 快照.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EBS 与 EBS 快照


## 从 EBS 快照 / AMI 创建卷

首次从 EBS 快照创建的卷,其读性能会差到离谱!
而 AMI 镜像实质就是一个 EBS 快照,所以首次从 AMI 创建的 EC2 实例,其读性能也会差到离谱!

根据官方文档 [初始化 Amazon EBS 卷](https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/ebs-initialize.html),需要通过手动预热的方式来解决这个性能问题。

但我实测对于数据较大的卷,用这种方式进行预热,需要的时间太长了(读速度不到 8M/s),不太现实。

所以我的建议是:不要在 AMI 镜像中放太多数据,尽量在启动实例后再通过其他方式从 S3 或其他节点上拉取数据。

10 changes: 10 additions & 0 deletions cloud-provider/aws/EC2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,13 @@ cloudinit: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#us

EKS 的 AMI 对各机型的支持可以参考 [amazon-eks-ami/files/eni-max-pods.txt](https://github.com/awslabs/amazon-eks-ami/blob/v20211109/files/eni-max-pods.txt) 与仓库 tag.

## EC2 启动速度研究

2023 年最新的非官方启动速度测试: https://www.martysweet.co.uk/ec2-launch-times/

总结中的几个点:

1. EBS encryption currently increases the time spent in the pending state for freshly launched instances.
2. Unencrypted gp2, gp3 or io1 result in the lowest time spent in the pending instance state for freshly launched instances.
3. Use Amazon Linux 2023 or Amazon Linux 2 EKS for the fastest general-purpose AMI to boot for launches and stop/starts.

0 comments on commit b186e7d

Please sign in to comment.