Today, I tried to use the MongoDB database on a 64-bit server. The disk array of the server's hard disk is composed of 10 Gb hard disks. Because of the consideration of using the master/salve mechanism for backup, the hard disk can be fully utilized, therefore, the RAID 5 array is used. However, after the 64-bit system is installed with MongoDB, the local database will directly use 70 GB. Check the cause and find that MongoDB uses 5% space as the log storage by default in 64-Bit mode. After testing, it is found that the master/salve mechanism is not used, and this problem does not occur in 32-bit systems. Because MongoDB can reuse the log space cyclically, add it as a file server, and finally set the oplogsize to 10 Gb for testing. MongoDB received 1 GB physical files on the 32-bit server, which would waste 2 GB space!
Then, when the MongoDB ing file eats the memory, MongoDB will eat all the idle memory on the server, resulting in full use of the service. At this time, the efficiency of concurrent writing to MongoDB is greatly reduced. But the reading performance is still very high, because the memory is mapped to a large number of hotspots, you can quickly read data. However, writing is a problem. First, the server should use the memory for writing. At this time, the write efficiency is reduced. Second, in the case of synchronization or backup, there cannot be any extra memory for this type of work. I feel that the memory control of MongoDB should be designed to be controllable, at least to ensure the Write Performance and synchronization performance of the master service, and the read work should be shared on the salve server, A considerable amount of memory should be reserved for the master to facilitate better work. The headache is that a large number of files need to be included in MongoDB, whether it is single-thread or multi-thread writing. When the server memory is used up, the write efficiency is getting lower and lower. The memory can only be released without stopping, and the efficiency can be improved. This is the biggest headache currently.