仅几个问题是顺序I/O和OPLOG与范围存储的问题。如果I/O在本质上被认为是顺序的,那么这会始终绕过OPLOG,或者仅在写操作大于1MB时才绕过?绕过OPLOG是否意味着相比之下的写作会慢得多?它仍然达到SSD,因此我的假设是它将是相同的。为什么在依次排出它们之前将写作的过程融合在一起有助于绩效?我对为什么需要直接写入SSD然后复制出来的步骤感兴趣。
最好的答案阿罗纳
You read the data after you write it. Just like me writing this right now. Imagine that you\u2019re working with the alphabet. You can write a b c d e \u2026 z or you can write a y h i \u2026 c b l \u2026 k.<\/p>
In both instances, the task is the same \u2013 to read the letters in alphabetical order. Which scenario is going to take you longer? (Please disregard the fact that you can reproduce the order from memory without reading it)<\/p>
It gets a little more complicated in real life where there are multiple layers of data organisation but in a nutshell, this is why sequenced I\/O is better than random.<\/p>
The write is received and evaluated. If it\u2019s sequential then it is written to the extent store. If it is random then it hangs out in the oplog until either it becomes part of the sequence (and is drained) or it is overwritten.<\/p>
Draining oplog sequentially means to write pieces of data not as they appear in the oplog but in the order to the extent store. Instead of writing a y h i \u2026 c b l \u2026 k the extent store will receive a b c d e \u2026 z. In that way, when the read request comes for a letter, a number of them or a sequence, it is easy to locate them on the extent store. Think of it as looking for a file or a folder on your computer. You either sort it by date or alphabetical order but you sort it to find what you\u2019re looking for.<\/p>
The data that has been touched recently is likely to be touched again soon. That\u2019s why the buffers are everywhere: RAM, your recent files in any text editor, your recent file in any file browser that you use, NICs have sort of a cache to handle bursts of I\/O too.<\/p>","className":"post__content__best_answer"}">