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
2b9fb4aa
Commit
2b9fb4aa
authored
Oct 20, 2015
by
Fred Smith
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2381 from edx/derf/hugepages_upstart_script
hugepages upstart script
parents
67c280e5
8e230288
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
70 deletions
+22
-70
playbooks/roles/mongo_3_0/files/disable-transparent-hugepages
+0
-68
playbooks/roles/mongo_3_0/files/disable-transparent-hugepages.conf
+11
-0
playbooks/roles/mongo_3_0/tasks/main.yml
+11
-2
No files found.
playbooks/roles/mongo_3_0/files/disable-transparent-hugepages
deleted
100644 → 0
View file @
67c280e5
#!/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/files/disable-transparent-hugepages.conf
0 → 100644
View file @
2b9fb4aa
description
"set transparent hugepage to never"
start
on
starting
mongod
task
script
env
thp_path
=/
sys
/
kernel
/
mm
/
transparent_hugepage
exec
echo
'never'
> ${
thp_path
}/
enabled
exec
echo
'never'
> ${
thp_path
}/
defrag
end
script
playbooks/roles/mongo_3_0/tasks/main.yml
View file @
2b9fb4aa
...
...
@@ -23,10 +23,19 @@
force=yes
when
:
mongodb_needs_upgrade.stat.exists and not MONGO_CLUSTERED
-
name
:
remove old init script for hugepages
file
:
>
path=/etc/init.d/disable-transparent-hugepages
state=absent
tags
:
-
"
hugepages"
-
"
install"
-
"
install:system-requirements"
-
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
src=disable-transparent-hugepages
.conf
dest=/etc/init
/disable-transparent-hugepages.conf
owner=root
group=root
mode=0755
...
...
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