I want to shard a collection of around 230 million documents. It has been suggested that I pre-split the collection before enabling sharding. I ran a local test using db.runCommand({split: "my_collection", middle: { a: prefix, b : 1}}). I am using a compound key for sharding and just want to split on the first portion.
How can I check that pre-splitting works? db.printShardingStatus() shows nothing since I haven't actually sharded the collection yet. I'm worried that if I attempt to shard the collection, the pre-split will not have taken affect or will not be quite right and will severely impact performance.
<patr...@springmetrics.com> wrote: > I want to shard a collection of around 230 million documents. It has been > suggested that I pre-split the collection before enabling sharding. I ran a > local test using db.runCommand({split: "my_collection", middle: { a: prefix, > b : 1}}). I am using a compound key for sharding and just want to split on > the first portion.
> How can I check that pre-splitting works? db.printShardingStatus() shows > nothing since I haven't actually sharded the collection yet. I'm worried > that if I attempt to shard the collection, the pre-split will not have taken > affect or will not be quite right and will severely impact performance.
> Thoughts?
> Patrick
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@googlegroups.com. > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en.
> Each time you do a split you should see the chunk count increase in > the output of printShardingStatus().
> Can you please post the output of printShardingStatus()?
> On Wed, Apr 25, 2012 at 6:11 AM, Patrick Scott > <patr...@springmetrics.com> wrote: > > I want to shard a collection of around 230 million documents. It has been > > suggested that I pre-split the collection before enabling sharding. I > ran a > > local test using db.runCommand({split: "my_collection", middle: { a: > prefix, > > b : 1}}). I am using a compound key for sharding and just want to split > on > > the first portion.
> > How can I check that pre-splitting works? db.printShardingStatus() shows > > nothing since I haven't actually sharded the collection yet. I'm worried > > that if I attempt to shard the collection, the pre-split will not have > taken > > affect or will not be quite right and will severely impact performance.
> > Thoughts?
> > Patrick
> > -- > > You received this message because you are subscribed to the Google Groups > > "mongodb-user" group. > > To post to this group, send email to mongodb-user@googlegroups.com. > > To unsubscribe from this group, send email to > > mongodb-user+unsubscribe@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/mongodb-user?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@googlegroups.com. > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en.
Yes, the chunks are just metadata in the config servers. There does not need to be any actual data to do the splits/migrates -- it is just a logical (metadata) operation without data.
<patr...@springmetrics.com> wrote: > Hmmm, I'm afraid to try it on my production setup. I may need to get my test > cluster back up and running.
> Should the chunk count increase before I actually shard the collection?
> On Wed, Apr 25, 2012 at 9:13 AM, Scott Hernandez <scotthernan...@gmail.com> > wrote:
>> Each time you do a split you should see the chunk count increase in >> the output of printShardingStatus().
>> Can you please post the output of printShardingStatus()?
>> On Wed, Apr 25, 2012 at 6:11 AM, Patrick Scott >> <patr...@springmetrics.com> wrote: >> > I want to shard a collection of around 230 million documents. It has >> > been >> > suggested that I pre-split the collection before enabling sharding. I >> > ran a >> > local test using db.runCommand({split: "my_collection", middle: { a: >> > prefix, >> > b : 1}}). I am using a compound key for sharding and just want to split >> > on >> > the first portion.
>> > How can I check that pre-splitting works? db.printShardingStatus() shows >> > nothing since I haven't actually sharded the collection yet. I'm worried >> > that if I attempt to shard the collection, the pre-split will not have >> > taken >> > affect or will not be quite right and will severely impact performance.
>> > Thoughts?
>> > Patrick
>> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "mongodb-user" group. >> > To post to this group, send email to mongodb-user@googlegroups.com. >> > To unsubscribe from this group, send email to >> > mongodb-user+unsubscribe@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/mongodb-user?hl=en.
>> -- >> You received this message because you are subscribed to the Google Groups >> "mongodb-user" group. >> To post to this group, send email to mongodb-user@googlegroups.com. >> To unsubscribe from this group, send email to >> mongodb-user+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/mongodb-user?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@googlegroups.com. > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en.
> Yes, the chunks are just metadata in the config servers. There does > not need to be any actual data to do the splits/migrates -- it is just > a logical (metadata) operation without data.
> On Wed, Apr 25, 2012 at 6:26 AM, Patrick Scott > <patr...@springmetrics.com> wrote: > > Hmmm, I'm afraid to try it on my production setup. I may need to get my > test > > cluster back up and running.
> > Should the chunk count increase before I actually shard the collection?
> > On Wed, Apr 25, 2012 at 9:13 AM, Scott Hernandez < > scotthernan...@gmail.com> > > wrote:
> >> Each time you do a split you should see the chunk count increase in > >> the output of printShardingStatus().
> >> Can you please post the output of printShardingStatus()?
> >> On Wed, Apr 25, 2012 at 6:11 AM, Patrick Scott > >> <patr...@springmetrics.com> wrote: > >> > I want to shard a collection of around 230 million documents. It has > >> > been > >> > suggested that I pre-split the collection before enabling sharding. I > >> > ran a > >> > local test using db.runCommand({split: "my_collection", middle: { a: > >> > prefix, > >> > b : 1}}). I am using a compound key for sharding and just want to > split > >> > on > >> > the first portion.
> >> > How can I check that pre-splitting works? db.printShardingStatus() > shows > >> > nothing since I haven't actually sharded the collection yet. I'm > worried > >> > that if I attempt to shard the collection, the pre-split will not have > >> > taken > >> > affect or will not be quite right and will severely impact > performance.
> >> > Thoughts?
> >> > Patrick
> >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups > >> > "mongodb-user" group. > >> > To post to this group, send email to mongodb-user@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > mongodb-user+unsubscribe@googlegroups.com. > >> > For more options, visit this group at > >> > http://groups.google.com/group/mongodb-user?hl=en.
> >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "mongodb-user" group. > >> To post to this group, send email to mongodb-user@googlegroups.com. > >> To unsubscribe from this group, send email to > >> mongodb-user+unsubscribe@googlegroups.com. > >> For more options, visit this group at > >> http://groups.google.com/group/mongodb-user?hl=en.
> > -- > > You received this message because you are subscribed to the Google Groups > > "mongodb-user" group. > > To post to this group, send email to mongodb-user@googlegroups.com. > > To unsubscribe from this group, send email to > > mongodb-user+unsubscribe@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/mongodb-user?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "mongodb-user" group. > To post to this group, send email to mongodb-user@googlegroups.com. > To unsubscribe from this group, send email to > mongodb-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/mongodb-user?hl=en.
<patr...@springmetrics.com> wrote:
> I want to shard a collection of around 230 million documents. It has been
> suggested that I pre-split the collection before enabling sharding. I ran a
> local test using db.runCommand({split: "my_collection", middle: { a: prefix,
> b : 1}}). I am using a compound key for sharding and just want to split on
> the first portion.
> How can I check that pre-splitting works? db.printShardingStatus() shows
> nothing since I haven't actually sharded the collection yet. I'm worried
> that if I attempt to shard the collection, the pre-split will not have taken
> affect or will not be quite right and will severely impact performance.
> Thoughts?
> Patrick
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.