Add numactl feature for mongo instances (#17)

* Add numactl package to Dockerfile

* add NUMACTL env var for launc mongod/s instance

* Moved NUMACTL command to libmongodb.sh

* add numactl command

* Update mongodb-env.sh

Changed var NUMACTL var name in MONGODB_ENABLE_NUMACTL

* Update libmongodb.sh

Changed NUMACTL var name to MONGODB_ENABLE_NUMACTL

* Update Dockerfile

Removed comments

* Update Dockerfile

removed comment
This commit is contained in:
F43RY
2021-07-28 14:01:06 +02:00
committed by GitHub
parent 3aacfb0f76
commit 7624f0878e
4 changed files with 15 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ ENV HOME="/" \
COPY prebuildfs /
# Install required system packages and dependencies
RUN install_packages acl ca-certificates curl gzip libc6 libcom-err2 libcurl4 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libnettle6 libnghttp2-14 libp11-kit0 libpcap0.8 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl1.1 libtasn1-6 libunistring2 procps tar zlib1g
RUN install_packages acl ca-certificates curl gzip libc6 libcom-err2 libcurl4 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libnettle6 libnghttp2-14 libp11-kit0 libpcap0.8 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl1.1 libtasn1-6 libunistring2 procps tar zlib1g numactl
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "yq" "3.4.1-0" --checksum c88c76a7b5214407821771e5fc340f0320d5ded19eada938629603a982b8b640
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.0-3" --checksum 7521d9a4f9e4e182bf32977e234026caa7b03759799868335bccb1edd8f8fd12
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "render-template" "1.0.0-3" --checksum 8179ad1371c9a7d897fe3b1bf53bbe763f94edafef19acad2498dd48b3674efe

View File

@@ -215,9 +215,17 @@ mongodb_start_bg() {
is_mongodb_running && return
if am_i_root; then
debug_execute gosu "$MONGODB_DAEMON_USER" "$MONGODB_BIN_DIR/mongod" "${flags[@]}"
if [ "${MONGODB_ENABLE_NUMACTL}" = true ]; then
debug_execute gosu "$MONGODB_DAEMON_USER" numactl --interleave=all "$MONGODB_BIN_DIR/mongod" "${flags[@]}"
else
debug_execute gosu "$MONGODB_DAEMON_USER" "$MONGODB_BIN_DIR/mongod" "${flags[@]}"
fi
else
debug_execute "$MONGODB_BIN_DIR/mongod" "${flags[@]}"
if [ "${MONGODB_ENABLE_NUMACTL}" = true ]; then
debug_execute numactl --interleave=all "$MONGODB_BIN_DIR/mongod" "${flags[@]}"
else
debug_execute "$MONGODB_BIN_DIR/mongod" "${flags[@]}"
fi
fi
# wait until the server is up and answering queries

View File

@@ -16,7 +16,10 @@ export BITNAMI_VOLUME_DIR="/bitnami"
# Logging configuration
export MODULE="${MODULE:-mongodb}"
export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}"
export BITNAMI_DEBUG="${BITNAMI_DEBUG:-true}"
#numactl configuration
export MONGODB_ENABLE_NUMACTL="${MONGODB_ENABLE_NUMACTL:-false}"
# By setting an environment variable matching *_FILE to a file path, the prefixed environment
# variable will be overridden with the value specified in that file