gpt4 book ai didi

amazon-web-services - 预热 EBS 卷

转载 作者:行者123 更新时间:2023-12-04 08:18:40 25 4
gpt4 key购买 nike

除了使用以下命令外,还有其他方法可以预热 PIOPS EBS 卷吗?

sudo dd if=/dev/xvdf of=/dev/null bs=1M

随着 EBS vol 的大小增加,上述命令似乎需要更长的时间。

所以在我的情况下,理想情况下,我想使用我的快照创建一个卷,并且在最短的停机时间内我想将该卷用作我的 mysql 数据目录,但在此之前我想预热它。如果有办法加快这个过程,那就太好了。但是,我们在硬件方面没有挑战,我们可以根据 AWS 的要求使用更大的机器。

最佳答案

您声明“想要使用我的快照创建卷”,因此通过写入数据进行预热不是一个好主意。相反,您应该 阅读 数据,这将导致数据从快照加载到您的 EBS 卷上。
来自 Pre-Warming Amazon EBS Volumes :

When you create any new EBS volume (General Purpose (SSD), Provisioned IOPS (SSD), or Magnetic) or restore a volume from a snapshot, the back-end storage blocks are allocated to you immediately. However, the first time you access a block of storage, it must be either wiped clean (for new volumes) or instantiated from its snapshot (for restored volumes) before you can access the block. This preliminary action takes time and can cause a 5 to 50 percent loss of IOPS for your volume the first time each block is accessed. For most applications, amortizing this cost over the lifetime of the volume is acceptable. Performance is restored after the data is accessed once.

However, you can avoid this performance hit in a production environment by writing to or reading from all of the blocks on your volume before you use it; this process is called pre-warming. Writing to all of the blocks on a volume is preferred, but that is not an option for volumes that were restored from a snapshot, because that would overwrite the restored data. For a completely new volume that was created from scratch, you should write to all blocks before using the volume. For a new volume created from a snapshot, you should read all the blocks that have data before using the volume.


预热磁盘(通过读取或写入)可能需要很长时间。磁盘越大,所需的时间越长。如果可能,避免预热。相反,只需像往常一样使用它。最坏的情况是,当第一次访问每个块时,您的访问速度会稍慢,这通常不是问题(除非您正在执行速度测试)。

关于amazon-web-services - 预热 EBS 卷,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30595978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com