From 5be413e2dd754c1b45531ecb89b5e1b037420cd5 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sat, 19 May 2018 09:13:36 +0200 Subject: [PATCH] Use jemalloc memory allocator as recommended by Discourse team --- scripts/_common.sh | 4 ++-- scripts/install | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 36d845e..ab3aec9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,7 +3,7 @@ # Common variables # -pkg_dependencies="zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt1-dev checkinstall libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle" +pkg_dependencies="libjemalloc1 libjemalloc-dev zlib1g-dev libreadline-dev libpq-dev libssl-dev libyaml-dev libcurl4-openssl-dev libapr1-dev libxslt1-dev checkinstall libxml2-dev vim imagemagick postgresql postgresql-server-dev-all postgresql-contrib optipng jhead jpegoptim gifsicle" RUBY_VERSION="2.4.4" # Execute a command as another user with login @@ -457,7 +457,7 @@ ynh_install_ruby () { test -x /usr/bin/ruby_rbenv && mv /usr/bin/ruby_rbenv /usr/bin/ruby # Install the requested version of ruby - CONFIGURE_OPTS="--disable-install-doc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version + CONFIGURE_OPTS="--disable-install-doc --with-jemalloc" MAKE_OPTS="-j2" rbenv install --skip-existing $ruby_version # Store the ID of this app and the version of ruby requested for it echo "$YNH_APP_ID:$ruby_version" | tee --append "$rbenv_install_dir/ynh_app_version" diff --git a/scripts/install b/scripts/install index 7048e49..fb1c284 100644 --- a/scripts/install +++ b/scripts/install @@ -274,6 +274,7 @@ else fi ynh_replace_string "__ADDITIONAL_ENV__" "$additional_env" "../conf/systemd.service" +ynh_replace_string "__LIBJEMALLOC__" "$(ldconfig -p | grep libjemalloc | awk 'END {print $NF}')" "../conf/systemd.service" ynh_add_systemd_config #=================================================