-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Service Arch
-
Fully Compatible
-
v6.0, v5.0, v4.4
-
Service Arch 2023-02-20, Service Arch 2023-03-06, Service Arch 2023-03-20, Service Arch 2023-04-03, Service Arch 2023-04-17
-
(copied to CRM)
When mongod is under intense memory pressure on systems that do not have swap space, the operating system pages out the only pages it can when mongod makes a request for more privately mapped memory: program text segment (code) pages. It pages them out because they are available for retrieval from stable storage. Unfortunately, this means that under heavy load mongod spends an immense amount of time paging code in from disk, which can make the system become unresponsive when it would be better for it to crash.
We should offer the option to pin code segments in memory via the mlock(2) syscall. The stack tracing machinery already knows how to find the base address of every code segment loaded into the process, and could be extended with modest effort to also report the size of those segments. This would in turn allow us to invoke `mlock` to pin those pages in memory.
- is related to
-
SERVER-77226 Fix permissions-checking when pinning code segments
- Closed
- related to
-
SERVER-75632 Enable lockCodeSegmentsInMemory in config fuzzer suites
- Backlog