Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8263043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:57:51+00:00 2026-06-08T03:57:51+00:00

I am trying to make sure that I understand what happens when I add

  • 0

I am trying to make sure that I understand what happens when I add a new Shard (Replica Set) to an existing Shard Cluster. When I add these new members and it sees that there is a new Shard Member available Mongo then starts to re-arrange the chunks so that it can take advantage of the new members correct? What sort of impacts to you get when this happens? As always I would assume you want to try and add these members as soon as you start to see unfavorable performance numbers (If other tuning options are not helping).

Just wanted to get a better understanding of what happens when you add a Shard when a cluster already exists.

Thanks,

S

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:57:53+00:00Added an answer on June 8, 2026 at 3:57 am

    When you add a shard to an existing cluster, it will automatically become the shard with the lowest number of chunks for every sharded collection. That means that it will be the default target for migrations (from the shard with the highest number of chunks) until things get more balanced. However, each shard primary (which is responsible for the migrations) can only take part in one migration at a time. As such, the balancing is going to take a while, especially if things are under load.

    In terms of the migrations themselves, you are seeing them in your current cluster already, so that is how to judge their impact. You can view the recent migrations in the logs, or you can take a look at the changelog (a 10MB capped collection that contains the most recent migrations/splits etc.):

    // connect to a mongos, switch to the config DB
    use config
    // look at the changelog
    db.changelog.find()
    

    In terms of what operations happen, well to move a chunk:

    1. The documents that make up that chunk must be read into memory on the source shard if not already there (so a fairly standard read)
    2. They are then sent to the destination shard (a fairly standard insert/write)
    3. Finally, after the meta data has been updated, they are removed from the source shard.

    Step 3 is a delete, which requires a write lock on the source shard, but it should be quite fast – the documents are already in memory from the migration.

    One other impact of increasing the frequency of the migrations is that the shard version is going to be updated more frequently – in particular the major shard version (so that it has an up to date mapping of chunks to shards.

    That means that you will see more logged messages about the mongos needing to refresh its config and update its shard version. It may also be a good idea to run the flushRouterConfig command before you kick off long running operations like Map/Reduce or findAndModify.

    If your shards have periods of low usage, you will see the migrations happen more quickly, and you can also consider using the balancer window option to only run balancing during certain times if you do notice a significant impact.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make sure that my Managed to Unmanaged calls are optimized. Is
I am trying to download a CSV file using HttpResponse to make sure that
I have been trying to test my application to make sure that all the
I am trying to create a validation that checks to make sure a domain/url
I'm still picking up ObjC and I'm just trying to make sure I understand
I'm trying to create a function that will check to make sure all the
I'm trying to make sure I understand my (digital) signal processing knowledge, by realizing
I'm trying to make sure my web application is always centered on the screen
I am trying to make sure all my inputs are secure, protecting the server
I finished my small application and I am trying to make sure I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.