Using WSRM to restrict MongoDB memory under windows

Source: Internet
Author: User
Tags mongodb limit server memory

There is a project to use MongoDB, we are deployed in the Windows 2008 64-bit environment, why not deploy to Linux under it, we do not have so many servers, can only be a bit.

We all know that MongoDB eat memory is too strong, if not restart the service, memory has been rubbing to rise, timed to restart the MongoDB service can temporarily recover memory, but this is not a long-term. If you do not limit MongoDB memory then how much of the system memory can be consumed by it, our server also has IIS, SQL Server, Redis and other services, can not fully allocate memory to MONGODB use, how to limit the memory of MongoDB?

To solve this problem, I found Windows 2008 comes with Windows System Explorer that works well and solves this problem perfectly. I will configure the method step by step to write down, in order to later query up also convenient.

1. Install Windows System Resource Manager

Open: Start--Administrative Tools--Server Manager

Select "Features"--add features--tick Windows system resources manager

Click "Add Required Features" in the pop-up window.

Next---Install

Wait 1 minutes or so Windows System Manager is installed

Open Windows system Resources Manager

Select Manage this computer---connection

Right--Create a new resource-allocation policy on a resource-allocation policy

Fill out a name, such as Mongodb Limit, and click the Add button below

Drop-down process matching criteria in regular window--new

In the pop-up window, continue to click Add

Because MongoDB on my server is registered as a service, select here: Registered service, then click the "Select" button on the right.

Find MongoDB Services in a wide range of services

"OK"

Back to the General page of resource allocation, where we limit the CPU to 40%

Switch to the memory page

To test, we limit the memory to 1000M

Set it up so you can see our new strategy here.

In order to make the new strategy work, we also need a few clicks of the mouse to complete the final operation:

Right-click on the Explorer to expand the menu and select "Properties"

Modify the calendar to Disabled, and then select the current resource allocation policy for our new mongodblimit

After the confirmation found in the Mongodblimit after a {management} words, explain our settings its effect.

We restarted the MongoDB service and found that the maximum memory limit was near 1000MB

Finally, there is no need to worry about the server memory is not enough, you can sleep soundly a good sleep.

Using WSRM to restrict MongoDB memory under windows

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.