如何“热身” EC2/EBS存储?

发布于 2024-09-26 18:44:12 字数 558 浏览 5 评论 0原文

我看到过“预热”EC2 以克服首次写入惩罚的建议:-

预热数据分区 - 有一个 在 EC2 中使用磁盘 IO 的缺点: “首次写入”性能受到影响时 最初写入新分区。 为了避免这种惩罚,您可以“温暖 通过执行排序来向上”分区 访问的一次性命令 它。例如,您可以使用Linux dd 命令写入磁盘。尽管 处罚仍然发生并且不能 避免,至少第一次写入 您的数据库不会受到 效果。

来源:http: //answers.oreilly.com/topic/1345-getting-the-most-out-of-mysql-in-the-amazon-cloud/

...但我还没有找到任何关于最佳的进一步建议实践! EBS存储也是如此吗?任何人都可以推荐将执行此预热的“dd”语法以及如何确保所有块都“预热”吗?

I have seen advice to 'warm up' EC2 to overcome a first write penalty:-

Warm up data partitions - There is one
drawback to using disk IO in EC2: a
“first write” performance hit when
initially writing to new partitions.
To avoid this penalty, you can “warm
up” the partition by executing a sort
of throw-away command that accesses
it. For example, you can use the Linux
dd command to write to the disk. While
the penalty still occurs and cannot be
avoided, at least the first write to
your databases will not suffer the
effects.

Source: http://answers.oreilly.com/topic/1345-getting-the-most-out-of-mysql-in-the-amazon-cloud/

...but I haven't found any further advice on best practice! Is this true of EBS storage? Can anyone recommend the 'dd' syntax that will perform this warmup and how to ensure that all blocks are 'warmed'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天生の放荡 2024-10-03 18:44:12

感谢您指向 AWS 论坛。我在此处发布后确实在那里发布了问题,并收到了 Jason@AWS 的回复。该线程在这里:-

http://developer.amazonwebservices.com/connect /message.jspa?messageID=198413#198413

...他的回应是:-

有一个首读惩罚
从快照创建的 EBS 卷,如
该卷之前可用
所有的块都已
加载成功。你可以否定
通过强制每个块来进行这种惩罚
待读卷数:

$ dd if=/dev/<设备>; of=/dev/null

Thanks for the pointer to AWS forum. I did post the question there after posting here, and received a response from Jason@AWS. The thread is here:-

http://developer.amazonwebservices.com/connect/message.jspa?messageID=198413#198413

...and his response was:-

There is a first- read penalty for
EBS volumes created from snapshots, as
the volume is made available before
all of the blocks have been
successfully loaded. You can negate
this penalty by forcing every block on
the volume to be read:

$ dd if=/dev/<device> of=/dev/null

枕头说它不想醒 2024-10-03 18:44:12

http://docs.aws.amazon.com/AWSEC2/latest /UserGuide/ebs-prewarm.html表示可以通过读取整个磁盘来预热快照卷;这可以加快读取速度。快照和非快照卷可以通过写入整个磁盘来预热写入。

当您创建新的 EBS 卷或从快照恢复卷时,后端存储块会立即分配给您。但是,第一次访问存储块时,必须将其擦除干净(对于新卷)或从其快照实例化(对于恢复的卷),然后才能访问该块。此初步操作需要时间,并且可能会导致首次访问每个块时卷的 IOPS 损失 5% 到 50%。

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-prewarm.html indicates that snapshot volumes can be prewarmed by reading the entire disk; this speeds up reads. Snapshot and non-snapshot volumes can prewarm writes by writing the entire disk.

When you create a new EBS volume 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文