Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
e4404ea2
Commit
e4404ea2
authored
Oct 06, 2015
by
Fred Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OPS-966 - disable transparent hugepages
parent
1393d782
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
1 deletions
+83
-1
playbooks/roles/mongo_3_0/files/disable-transparent-hugepages
+68
-0
playbooks/roles/mongo_3_0/tasks/main.yml
+15
-1
No files found.
playbooks/roles/mongo_3_0/files/disable-transparent-hugepages
0 → 100644
View file @
e4404ea2
#!/bin/sh
### BEGIN INIT INFO
# Provides: disable-transparent-hugepages
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: mongod mongodb-mms-automation-agent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Disable Linux transparent huge pages
# Description: Disable Linux transparent huge pages, to improve
# database performance.
### END INIT INFO
case
$1
in
start
)
if
[
-d
/sys/kernel/mm/transparent_hugepage
]
;
then
thp_path
=
/sys/kernel/mm/transparent_hugepage
elif
[
-d
/sys/kernel/mm/redhat_transparent_hugepage
]
;
then
thp_path
=
/sys/kernel/mm/redhat_transparent_hugepage
else
return
0
fi
echo
'never'
>
${
thp_path
}
/enabled
echo
'never'
>
${
thp_path
}
/defrag
unset
thp_path
;;
stop
)
if
[
-d
/sys/kernel/mm/transparent_hugepage
]
;
then
thp_path
=
/sys/kernel/mm/transparent_hugepage
elif
[
-d
/sys/kernel/mm/redhat_transparent_hugepage
]
;
then
thp_path
=
/sys/kernel/mm/redhat_transparent_hugepage
else
return
0
fi
echo
'always'
>
${
thp_path
}
/enabled
echo
'always'
>
${
thp_path
}
/defrag
unset
thp_path
;;
status
)
if
[
-d
/sys/kernel/mm/transparent_hugepage
]
;
then
thp_path
=
/sys/kernel/mm/transparent_hugepage
elif
[
-d
/sys/kernel/mm/redhat_transparent_hugepage
]
;
then
thp_path
=
/sys/kernel/mm/redhat_transparent_hugepage
else
return
0
fi
case
$(
cat
${
thp_path
}
/enabled | sed
-e
's/.*\[//'
-e
's/\].*//'
)
in
always
)
echo
"always"
return
1
;;
madvise
)
echo
"madvise"
return
1
;;
never
)
echo
"never"
return
0
;;
esac
unset
thp_path
;;
esac
playbooks/roles/mongo_3_0/tasks/main.yml
View file @
e4404ea2
...
...
@@ -22,7 +22,21 @@
state=absent purge=yes
force=yes
when
:
mongodb_needs_upgrade.stat.exists and not MONGO_CLUSTERED
-
name
:
disable transparent huge pages on startup (http://docs.mongodb.org/manual/tutorial/transparent-huge-pages/)
copy
:
>
src=disable-transparent-hugepages
dest=/etc/init.d/disable-transparent-hugepages
owner=root
group=root
mode=0755
-
name
:
disable transparent huge pages
service
:
>
name=disable-transparent-hugepages
enabled=yes
state=started
-
name
:
install python pymongo for mongo_user ansible module
pip
:
>
name=pymongo state=present
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment