Skip to content

695: New method for managing THP #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rhysmeister
Copy link
Collaborator

@rhysmeister rhysmeister commented Apr 9, 2025

SUMMARY

New method for managing THP. MongoDB 8 comes with a recommendation to turn thp on now.

TODO:

  • Should add tests for this.
  • Add a warning to release notes to cleanup old systemd service (/etc/systemd/system/disable-transparent-huge-pages.service) if appropriate.
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

mongodb_linux

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.44%. Comparing base (8d0b4d7) to head (3fb368b).

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #697     +/-   ##
=========================================
  Coverage   73.44%   73.44%             
=========================================
  Files          18        6     -12     
  Lines        2802      934   -1868     
  Branches      429      143    -286     
=========================================
- Hits         2058      686   -1372     
+ Misses        630      210    -420     
+ Partials      114       38     -76     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kroeschl
Copy link

I think we still need to support disabling transparent huge pages for MongoDB 7.0.

@rhysmeister
Copy link
Collaborator Author

Yes, that's still in place. The role should create the appropriate systemd service, to enable or disable thp, according to the value of mongodb_enable_thp.

@kroeschl
Copy link

Oops yep, I glanced at this and thought it was replacing the existing service. My bad!


[Service]
Type=oneshot
ExecStart=/usr/bin/env sh -c "echo 'always' > /sys/kernel/mm/transparent_hugepage/enabled && echo 'always' > /sys/kernel/mm/transparent_hugepage/defrag"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this was intentional, but this unit is quite different from the example provided in the MongoDB docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants