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

  • SEARCH
  • Home
  • 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 7574269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:23:44+00:00 2026-05-30T16:23:44+00:00

If a shard say has 200 chunks on it and it is time to

  • 0

If a shard say has 200 chunks on it and it is time to move some of those chunks to another shard,

1>how does mongo db decide which chunks to move?

2>Is this move logic in config server or mongos?

3>How can I affect/control chunk selection algorithm such that mongodb will move chunks to other shards such that it helps to distribute my reads based on my users access pattern?

  • 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-05-30T16:23:46+00:00Added an answer on May 30, 2026 at 4:23 pm

    Movement of chunks between shards is triggered by mongos. Mongos will move chunks under two circumstances. If one shard contains 9 or more chunks than any other, mongos will trigger a balancing round and redistribute the chunks between the other shards. In this situation, the chunks with the lowest shard keys will be moved. Additionally, if the top most chunk is split, mongos will move the chunk with the higher shard key to another shard.

    One of the features of Mongo is that in a properly set-up sharded cluster, chunks are split and moved automatically such that your application does not need to be aware that it is interacting with a sharded database. Everything happens behind-the-scenes.

    However, it is possible to split and move chunks manually using the “split” and “moveChunks” commands. Please see the mongo documentation for examples of how to use these commands: “Splitting Shard Chunks” http://www.mongodb.org/display/DOCS/Splitting+Shard+Chunks and “Moving
    Chunks” http://www.mongodb.org/display/DOCS/Moving+Chunks There have been cases where users have written their own custom balancers taylored to their own applications, but this is not common, and only attempted by the most advanced of users.

    As an alternative, it is possible to give the balancer window of time when it may operate, or to disable it entirely. Some users will temporarily disable the balancer for maintenance, or give it a window so it is not competing for write locks at times when they expect their application to be putting the db under high loads.

    More information on the balancer is available in the “Balancing” and “Balancer window” sections of the “Sharding Administration” documentation.
    http://www.mongodb.org/display/DOCS/Sharding+Administration

    Hopefully the above resources will give you a better understanding of how sharding works, and how chunks are balanced between shards.

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

Sidebar

Related Questions

We are experiencing a difficult problem which has been puzzling us for some time.
Does RabbitMQ call the callback function for a consumer when it has some message
I have been looking for this pattern for some time but still did not
I don't know if this has been discussed. Let's say you are in a
Let's say I start with replica sets and each mongo server has a 500G
Say I have a WCF service that has access to some data that is
MY APPLICATION STRUCTURE :My project (let us say AAA) which has packaging as JAR.
Lets say I have this class in foobar-shared.lib: class FooBar { std::string m_helloWorld; }
Let's say you recently discovered some major vulnerabilities in a couple of websites that
Our application has a lot of .NET assemblies, which up until now, has not

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.