When to start MongoDB sharding

We are currently running Replicaset MongoDB containing 2 servers + 1 Arbiter.

And we store about 150 GB of data in replicas databases.

Now we are thinking about when to start with shards. Because we are wondering if there is a moment when you can no longer begin to scald.

Obviously, we will have to start scalding before the lack of hard disk space is over, our processor is overloaded or the overall performance is reduced due to too little RAM.

Someone also told me that there is a data size limit of 256 GB, after which you can no longer start outlines. I also read the official documentation http://docs.mongodb.org/manual/sharding/ and "MongoDB - The Ultimate Guide", I could not read it.

From your experience, is there a limit in which you should have started with shards?

+6
source share
2 answers

I will start dumping when you hit about 60-70% of resource usage. This can be either hard disk space or RAM. The 256 GB limit is indeed there, it is documented at http://docs.mongodb.org/manual/reference/limits/#Sharding%20Existing%20Collection%20Data%20Size

+6
source

I found that the limit is based on reads / writes; after all the fragments are related to capacity increase, he writes mostly, while the replicas are more interested in reading. However, using separate servers (nodes) for data ranges (shard key) can also help read so that it has a knock effect for both.

For example, you can only use 40% of your current server memory with your current working set, but due to the number of emails sent to this single server, you can actually see speed problems due to I / O. At this time, you must consider the situation.

So, I would personally say, and this question is largely based on the opinions that you should fragment when you feel that you need more options for operations than it is economically viable for one set of replicas.

I know about the only replica settings that can accept what, as a rule, the entire cluster, but it depends on how big your budget is. When a computer gets more expensive, it gets more expensive.

+6
source

Source: https://habr.com/ru/post/950079/


All Articles