Facts learned during the Chunk migration test

I am testing the speed of chunk migration.

For those of you who already knew but didn’t know, I’m sharing what I found out during the test.

1. The speed of chunk migration is affected by documents, not chunks.

  • Chunk migration is literally a task of moving(copying and removing) chunks, I thought tuning points would be in the number and size of chunks.
  • However, as a result of the test, the tuning point was in the number and size of the documents.
  • It could be obvious. Because the moveChunk operation is actually moved and deleted in terms of documents within chunks.

2. The speed of chunk migration decreases as the work progresses.

  • This fact is not yet clear why. However, as the work progressed (between 45% and 60%), the work progress was slower than before.
  • Example: If it was 5% per day at first, it would be 3% at some point
  • I initially expected this to be an issue due to external factors, but there was no problem with the server and I found that the workload coming in has not changed.
  • So I thought that mongodb’s chunk migration was supposed to be like this.

3. You may be disappointed if you expect improvement in chunk migration performance through engine version up.

  • I am currently conducting tests using 4.2 and, to borrow from the vendor, if I upgrade to 4.4 I can expect a performance improvement in the chunk migration part.
  • However, as a result of test, it came out as follows.
    [No load, 2 Shards Sharded Cluster]
    #4.2 version → 80 chunks/hour
    #4.4 version → 31 chunks/hour
    #5.0 version → 32 chunks/hour
  • When the load was applied, 4.2 and 5.0 came out similar. However, 4.4 showed less than half the performance.
  • I think it is a part that needs more consideration to upgrade the version only to improve chunk migration performance.

This article can be lacking a lot because it was tested and written by me, who is a junior level.
Therefore, you can freely refute, give us your opinion, ask us questions, or answer.

Thank you. :smiley:

P.S. So why is chunk migration slowing down based on which point?..