[SERVER-27792] mongod is swapping with free ram and vm.swappinnes = 0 Created: 23/Jan/17  Updated: 24/Jan/17  Resolved: 24/Jan/17

Status: Closed
Project: Core Server
Component/s: WiredTiger
Affects Version/s: 3.2.5
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Igor Chelnokov [X] Assignee: Ramon Fernandez Marina
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Hello

We're running MongoDB 3.2.5 in a Docker container (official image).
Every other week I see mongod using 300-500M of swap. However, we have vm.swappiness = 0 and about 16G of usable RAM (used mostly for cache).

System info:
System: Dell PowerEdge R720xd (dual Xeon E5-2650, 32G RAM)

vm.zone_reclaim_mode = 0
vm.swappiness = 0

I assume that mongod is run with numactl --interleave=all

Engine used is wiredTiger.
mongod memory stats as reported by htop:
1532M RSS
2243M VSZ
446M swap

System RAM stats as per free -m:
Total 32127M
Free 1111M
Buffers 423M
Cache 18772M

Also, we have another instance of MongoDB on this same machine - 2.6, although it's barely ever used, it uses swap too (~5M with 41M RSS).

So, why does mongod use swap with free RAM available and vm.swappiness = 0?



 Comments   
Comment by Igor Chelnokov [X] [ 24/Jan/17 ]

Thanks for your answer!

Comment by Ramon Fernandez Marina [ 24/Jan/17 ]

Gendalph, the decision on when to use or not use swap is made by the OS, not by any user process. Wikipedia has a simple explanation of what vm.swappiness does, and a pointer to the Linux's VM doc for more details.

Please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag, where your question will reach a larger audience. A question like this involving more discussion would be best posted on the mongodb-user group. See also our Technical Support page for additional support resources.

Regards,
Ramón.

Generated at Thu Feb 08 04:16:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.