第13章計算の性能
13.4.3. Storage13.4.3 ストレージ
We saw that some of the key characteristics of RAM are bandwidth and latency. The same is true for storage devices, just that the differences can be even more extreme.
英語のヒント
RAMの重要な特徴のいくつかは帯域と遅延であることを見た。ストレージの装置にも同じことが言えるが、違いはさらに極端になりうる。
13.4.3.1. Hard Disk Drives13.4.3.1 ハードディスクドライブ
Hard disk drives (HDDs) have been in use for over half a century. In a nutshell they contain a number of spinning platters with heads that can be positioned to read or write at any given track. High-end disks hold up to 16 TB on 9 platters. One of the key benefits of HDDs is that they are relatively inexpensive. One of their many downsides are their typically catastrophic failure modes and their relatively high read latency.
英語のヒント
ハードディスクドライブ(HDD)は半世紀以上使われてきた。手短に言えば、それは回転する何枚かのプラッタを含み、ヘッドを任意のトラックに位置づけて読み書きできる。高性能なディスクは、9枚のプラッタに最大16 TBを格納する。HDDの主な利点の一つは、比較的安いことである。その多くの欠点の一つは、ふつう壊れ方が壊滅的であることと、読み出しの遅延が比較的大きいことである。
To understand the latter, consider the fact that HDDs spin at around 7,200 RPM (revolutions per minute). If they were much faster they would shatter due to the centrifugal force exerted on the platters. This has a major downside when it comes to accessing a specific sector on the disk: we need to wait until the platter has rotated in position (we can move the heads but not accelerate the actual disks). Hence it can take over 8 ms until the requested data is available. A common way this is expressed is to say that HDDs can operate at approximately 100 IOPs (input/output operations per second). This number has essentially remained unchanged for the past two decades. Worse still, it is equally difficult to increase bandwidth (it is in the order of 100–200 MB/s). After all, each head reads a track of bits, hence the bit rate only scales with the square root of the information density. As a result, HDDs are quickly becoming relegated to archival storage and low-grade storage for very large datasets.
英語のヒント
後者を理解するため、HDDが約7,200 RPM(毎分回転数)で回転するという事実を考えよう。もっとずっと速いと、プラッタにかかる遠心力のために砕けてしまう。これは、ディスク上の特定のセクターにアクセスするときに大きな欠点になる。プラッタが回転して位置に来るまで待つ必要がある(ヘッドは動かせるが、実際のディスクを加速することはできない)。したがって、要求したデータが使えるようになるまでに8 ms以上かかることがある。これをよく表す言い方は、HDDはおよそ100 IOPs(毎秒の入出力操作数)で動作できる、というものである。この数字は、過去20年間、本質的に変わっていない。さらに悪いことに、帯域を上げるのも同じくらい難しい(100〜200 MB/s程度である)。結局のところ、各ヘッドはビットのトラックを読むので、ビットレートは情報密度の平方根でしか増えない。その結果、HDDは急速に、アーカイブ用のストレージや、とても大きなデータセットのための低級なストレージへと追いやられつつある。
13.4.3.2. Solid State Drives13.4.3.2 ソリッドステートドライブ
Solid state drives (SSDs) use flash memory to store information persistently. This allows for much faster access to stored records. Modern SSDs can operate at 100,000 to 500,000 IOPs, i.e., up to 3 orders of magnitude faster than HDDs. Furthermore, their bandwidth can reach 1–3GB/s, i.e., one order of magnitude faster than HDDs. These improvements sound almost too good to be true. Indeed, they come with the following caveats, due to the way SSDs are designed.
英語のヒント
ソリッドステートドライブ(SSD)は、フラッシュメモリを使って情報を永続的に格納する。これにより、格納したレコードにずっと速くアクセスできる。現代のSSDは100,000〜500,000 IOPsで動作でき、HDDより最大3桁速い。さらに、その帯域は1〜3 GB/sに達し、HDDより1桁速い。これらの改善は、ほとんど話がうますぎるように聞こえる。実際、SSDの設計の仕方のために、次の注意点がある。
- SSDs store information in blocks (256 KB or larger). They can only be written as a whole, which takes significant time. Consequently bit-wise random writes on SSD have very poor performance. Likewise, writing data in general takes significant time since the block has to be read, erased and then rewritten with new information. By now SSD controllers and firmware have developed algorithms to mitigate this. Nonetheless, writes can be much slower, in particular for QLC (quad level cell) SSDs. The key for improved performance is to maintain a queue of operations, to prefer reads and to write in large blocks if possible.
英語のヒント
SSDは情報をブロック(256 KB以上)単位で格納する。ブロックは全体としてしか書き込めず、それにはかなりの時間がかかる。その結果、SSDでのビット単位のランダムな書き込みは性能がとても悪い。同じように、ブロックを読み、消去し、それから新しい情報で書き直さなければならないので、一般にデータの書き込みにはかなりの時間がかかる。いまでは、SSDのコントローラとファームウェアが、これを和らげるアルゴリズムを開発している。それでも、特にQLC(クアッドレベルセル)のSSDでは、書き込みはずっと遅くなりうる。性能を上げる鍵は、演算のキューを保ち、読み出しを優先し、できれば大きなブロックで書き込むことである。 - The memory cells in SSDs wear out relatively quickly (often already after a few thousand writes). Wear-level protection algorithms are able to spread the degradation over many cells. That said, it is not recommended to use SSDs for swapping files or for large aggregations of log-files.
英語のヒント
SSDのメモリセルは比較的速く消耗する(しばしば数千回の書き込みで早くも)。ウェアレベリングの保護アルゴリズムは、劣化を多くのセルに分散できる。とはいえ、ファイルのスワップや、大量のログファイルを集めるのにSSDを使うことは勧められない。 - Lastly, the massive increase in bandwidth has forced computer designers to attach SSDs directly to the PCIe bus. The drives capable of handling this, referred to as NVMe (Non Volatile Memory enhanced), can use up to 4 PCIe lanes. This amounts to up to 8GB/s on PCIe 4.0.
英語のヒント
最後に、帯域の大幅な増加により、コンピュータの設計者はSSDをPCIeバスに直接つながざるをえなくなった。これを扱えるドライブはNVMe(Non Volatile Memory enhanced)と呼ばれ、最大4本のPCIeレーンを使える。これは、PCIe 4.0で最大8 GB/sになる。
13.4.3.3. Cloud Storage13.4.3.3 クラウドストレージ
Cloud storage provides a configurable range of performance. That is, the assignment of storage to virtual machines is dynamic, both in terms of quantity and in terms of speed, as chosen by users. We recommend that users increase the provisioned number of IOPs whenever latency is too high, e.g., during training with many small records.
英語のヒント
クラウドストレージは、設定できる範囲の性能を与える。つまり、仮想マシンへのストレージの割り当ては、量の点でも速さの点でも、ユーザーが選ぶとおりに動的である。たとえば小さなレコードがたくさんある訓練のときのように、遅延が大きすぎるときはいつでも、ユーザーが割り当てるIOPsの数を増やすことを勧める。