MongoDB Ghost operation to avoid

Source: Internet
Author: User

The process of statically loading data into a collection may occur.

Suppose you set up a task: Thousands of updates in MongoDB, start the task quickly, terminate all update operations, but still find that new update tasks are constantly appearing, even though the task has stopped.

The reason: If you use non-responsive write (Unacknowledge write) to load data, the application can trigger write operations faster than MONGODB processing. If MongoDB is prepared, this batch of writes will accumulate in the socket cache (socket buffer) in the operating system. At this point, after terminating MongoDB's ongoing write operation, MongoDB begins processing the write operation of the cache. Because this batch of operations has been received by MongoDB, but has not been processed for the time being.

The best way to avoid this phantom operation is to use the answer write, that is, each write operation waits until the last write completes, rather than the next operation when the last write enters the buffer.

MongoDB Ghost operation to avoid

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.