scaling to 30,000 requests per second and beyond with mongodb
DESCRIPTION
Webinar from the MongoDB "Back to Basics" series given June 12, 2014. http://www.mongodb.com/webinar/BB3-perf-consid-June-2014TRANSCRIPT
![Page 1: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/1.jpg)
Scaling to 30,000 Requests Per Secondand Beyond
with MongoDB
Mike ChesnutDirector of Operations Engineering
Crittercism
![Page 2: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/2.jpg)
Scaling to 30,000 Requests Per Secondand Beyond
with MongoDB
Mike ChesnutDirector of Operations Engineering
Crittercism
40,000
![Page 3: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/3.jpg)
MongoDB World
June 23-25 world.mongodb.com
Code: 25GN for 25% off
![Page 4: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/4.jpg)
MongoDB World
June 23-25 world.mongodb.com
Code: 25GN for 25% off
![Page 5: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/5.jpg)
What I’ll Talk About
![Page 6: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/6.jpg)
What I’ll Talk About
● Crittercism - Overview● Router (mongos) Architecture● Sharding Considerations● The Balancer and Me● Q&A
![Page 7: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/7.jpg)
How a Startup Gets Started
![Page 8: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/8.jpg)
● Pick something and go with it● Make mistakes along the way● Correct the mistakes you can● Work around the ones you can’t
How a Startup Gets Started
![Page 9: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/9.jpg)
Critter-What?
A Brief History...
![Page 10: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/10.jpg)
Critter-What?
![Page 11: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/11.jpg)
Architecture
APIFeedback
![Page 12: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/12.jpg)
Architecture
APIFeedback
App Loads
Crashes
HandledExceptions
![Page 13: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/13.jpg)
Architecture
APIFeedback
App Loads
Crashes
HandledExceptions
![Page 14: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/14.jpg)
Architecture
DynamoDB
APIFeedback
App Loads
Crashes
HandledExceptions
Metadata
![Page 15: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/15.jpg)
Architecture
DynamoDB
APIFeedback
App Loads
Crashes
HandledExceptions
Metadata
![Page 16: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/16.jpg)
Architecture
DynamoDB
API
API
Feedback
App Loads
Crashes
HandledExceptions
Metadata
PerformanceData
Geo Data
![Page 17: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/17.jpg)
Critter-What?
… Which brings us to today.
![Page 18: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/18.jpg)
Critter-What?
![Page 19: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/19.jpg)
Critter-What?
● feedback widget
● crash reporting
● live stats
● crash grouping
● app performance management
● geo data
● user analytics
● executive dashboard
![Page 20: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/20.jpg)
Architecture
DynamoDB
API
API
Feedback
App Loads
Crashes
HandledExceptions
Metadata
PerformanceData
Geo Data
![Page 21: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/21.jpg)
Architecture
DynamoDB
API
API
Feedback
App Loads
Crashes
HandledExceptions
Metadata
PerformanceData
Geo Data
40,000+ req/s
![Page 22: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/22.jpg)
Growth
![Page 23: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/23.jpg)
Router Architecture
![Page 24: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/24.jpg)
Router Architecture
mongodserver
mongodserver
mongodserver
replica set
mongodserver
mongodserver
mongodserver
replica set
mongodserver
mongodserver
mongodserver
replica setmongos
clientprocess
application server
mongos
clientprocess
application server
Client Application(s) MongoDB Cluster
![Page 25: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/25.jpg)
Single mongos per client problems we encountered:
Router Architecture
![Page 26: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/26.jpg)
Router Architecture
Single mongos per client problems we encountered:● thousands of connections to config servers● config server CPU load● configdb propagation delays
![Page 27: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/27.jpg)
Router Architecture
mongodserver
mongodserver
mongodserver
replica set
mongodserver
mongodserver
mongodserver
replica set
mongodserver
mongodserver
mongodserver
replica set
mongos
clientprocess
application server
mongos
clientprocess
application server
Client Application(s) MongoDB ClusterRouter Tier
![Page 28: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/28.jpg)
Router Architecture
Separate mongos tier advantages:
![Page 29: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/29.jpg)
Router Architecture
Separate mongos tier advantages:● greatly reduced number of connections to each mongod● far fewer hosts talking to the config servers● much faster configdb propagation
![Page 30: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/30.jpg)
Router Architecture
Separate mongos tier advantages:● greatly reduced number of connections to each mongod● far fewer hosts talking to the config servers● much faster configdb propagation
Disadvantages:
![Page 31: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/31.jpg)
Router Architecture
Separate mongos tier advantages:● greatly reduced number of connections to each mongod● far fewer hosts talking to the config servers● much faster configdb propagation
Disadvantages:● additional network hop● fewer points of failure
![Page 32: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/32.jpg)
Sharding Considerations
![Page 33: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/33.jpg)
Pick something you want to live with.
Sharding Considerations
![Page 34: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/34.jpg)
Sharding Considerations
![Page 35: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/35.jpg)
Sharding Considerations
![Page 36: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/36.jpg)
Sharding Considerations
![Page 37: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/37.jpg)
Sharding Considerations
![Page 38: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/38.jpg)
Sharding Considerations
![Page 39: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/39.jpg)
Sharding Considerations
![Page 40: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/40.jpg)
Sharding Considerations
![Page 41: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/41.jpg)
Sharding Considerations
![Page 42: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/42.jpg)
Sharding Considerations
![Page 43: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/43.jpg)
Sharding Considerations
![Page 44: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/44.jpg)
Sharding Considerations
![Page 45: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/45.jpg)
Sharding Considerations
![Page 46: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/46.jpg)
Sharding Considerations
![Page 47: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/47.jpg)
Sharding Considerations
![Page 48: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/48.jpg)
Sharding Considerations
![Page 49: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/49.jpg)
The Balancer and Me
![Page 50: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/50.jpg)
The Balancer and Me
Why wouldn’t you run the balancer in the first place?● great question● for us, it’s because we deleted a ton of data at one point, and left a
bunch of holes○ we turned it off while deleting this data○ and then were unable to turn it back on
● but maybe you start without it● or maybe you need to turn it off for maintenance and forget to turn
it back on
Obviously, don’t do this. But if you do, here’s what happens...
![Page 51: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/51.jpg)
The Balancer and Me
Fresh, new, empty cluster… But no balancer running.
![Page 52: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/52.jpg)
The Balancer and Me
![Page 53: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/53.jpg)
The Balancer and Me
![Page 54: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/54.jpg)
The Balancer and Me
![Page 55: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/55.jpg)
The Balancer and Me
![Page 56: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/56.jpg)
The Balancer and Me
![Page 57: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/57.jpg)
The Balancer and Me
Now we’re pretty full, so let’s add another shard...
![Page 58: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/58.jpg)
The Balancer and Me
![Page 59: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/59.jpg)
The Balancer and Me
And keep inserting...
![Page 60: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/60.jpg)
The Balancer and Me
Suddenly we find ourselves with a very unbalanced cluster.
![Page 61: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/61.jpg)
The Balancer and Me
But if we enable the balancer, it will DoS the 5th shard!
![Page 62: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/62.jpg)
The Balancer and Me
The approximate effect looks something like this:
![Page 63: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/63.jpg)
The Balancer and Me
The approximate effect looks something like this:
![Page 64: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/64.jpg)
The Balancer and Me
The approximate effect looks something like this:
![Page 65: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/65.jpg)
The Balancer and Me
The approximate effect looks something like this:
![Page 66: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/66.jpg)
The Balancer and Me
The approximate effect looks something like this:
![Page 67: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/67.jpg)
The Balancer and Me
The approximate effect looks something like this:
![Page 68: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/68.jpg)
So what can we do?
The Balancer and Me
![Page 69: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/69.jpg)
So what can we do?
1. add IOPS
The Balancer and Me
![Page 70: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/70.jpg)
So what can we do?
1. add IOPS2. make sure your config servers have plenty of CPU (and IOPS)
The Balancer and Me
![Page 71: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/71.jpg)
So what can we do?
1. add IOPS2. make sure your config servers have plenty of CPU (and IOPS)3. slowly move chunks manually
The Balancer and Me
![Page 72: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/72.jpg)
So what can we do?
1. add IOPS2. make sure your config servers have plenty of CPU (and IOPS)3. slowly move chunks manually4. approach a balanced state
The Balancer and Me
![Page 73: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/73.jpg)
So what can we do?
1. add IOPS2. make sure your config servers have plenty of CPU (and IOPS)3. slowly move chunks manually4. approach a balanced state5. hold your breath
The Balancer and Me
![Page 74: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/74.jpg)
So what can we do?
1. add IOPS2. make sure your config servers have plenty of CPU (and IOPS)3. slowly move chunks manually4. approach a balanced state5. hold your breath6. try re-enabling the balancer
The Balancer and Me
![Page 75: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/75.jpg)
How to manually balance:
The Balancer and Me
![Page 76: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/76.jpg)
How to manually balance:
1. determine a chunk on a hot shard2. monitor effects on both the source and target shards3. move the chunk4. allow the system to settle5. repeat
The Balancer and Me
![Page 77: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/77.jpg)
How to manually balance:
1. determine a chunk on a hot shard
mongos> db.chunks.find({"shard":"<shard_name>",
"ns":"<db_name>.<collection>"}).limit(1).pretty()
You’ll get a single chunk (as both min and max); note its shard key and
ObjectId.
The Balancer and Me
![Page 78: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/78.jpg)
How to manually balance:
1. determine a chunk on a hot shard
"min" : {
"unsymbolized_hash" :
"1572663b72e87[...]",
"_id" : ObjectId("50b97db98238[...]")
},
The Balancer and Me
![Page 79: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/79.jpg)
How to manually balance:
1. determine a chunk on a hot shard2. monitor effects on both the source and target shards
iostat -xhm 1
mongostat
The Balancer and Me
![Page 80: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/80.jpg)
How to manually balance:
1. determine a chunk on a hot shard2. monitor effects on both the source and target shards3. move the chunk
mongos> sh.moveChunk("<db_name>.<collection>",
{ "unsymbolized_hash" : "1572663b72e87[...]",
"_id" : ObjectId("50b97db98238[...]") },
"<target_shard>")
The Balancer and Me
![Page 81: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/81.jpg)
How to manually balance:
1. determine a chunk on a hot shard2. monitor effects on both the source and target shards3. move the chunk4. allow the system to settle5. repeat
The Balancer and Me
![Page 82: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/82.jpg)
Conclusion here:
Run the balancer.
The Balancer and Me
![Page 83: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/83.jpg)
● Design ahead of timeo “NoSQL” lets you play it by earo but some of these decisions will bite you later
● Be willing to correct past mistakeso dedicate time and resources to adaptingo learn how to live with the mistakes you can’t correct
Summary
![Page 84: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/84.jpg)
References
● MongoDB Blog post:http://blog.mongodb.org/post/77278906988/crittercism-scaling-to-billions-of-requests-per-day-on
● MongoDB Documentation on mongos routers:http://docs.mongodb.org/master/core/sharded-cluster-query-routing/
● MongoDB Documentation on the balancer:http://docs.mongodb.org/manual/tutorial/manage-sharded-cluster-balancer/
● MongoDB Documentation on shard keys:http://docs.mongodb.org/manual/core/sharding-shard-key/
Crittercism: http://www.crittercism.com/
![Page 85: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/85.jpg)
MongoDB World
June 23-25 world.mongodb.com
Code: 25GN for 25% off
![Page 86: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/86.jpg)
Q&A
![Page 87: Scaling to 30,000 Requests Per Second and Beyond with MongoDB](https://reader035.vdocuments.us/reader035/viewer/2022062406/55906e281a28ab31228b456b/html5/thumbnails/87.jpg)
Thank You!