From 5e5e743dc83ecd8721c9bf99eea41a0f5778b4ee Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Thu, 17 Nov 2016 01:12:53 -0200 Subject: [PATCH] Adds jemalloc directly to ruby --- image/base/Dockerfile | 6 +++--- templates/web.template.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/image/base/Dockerfile b/image/base/Dockerfile index 824559b..bfdcd81 100644 --- a/image/base/Dockerfile +++ b/image/base/Dockerfile @@ -55,12 +55,12 @@ RUN apt-get -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng RUN mkdir /jemalloc && cd /jemalloc &&\ wget https://github.com/jemalloc/jemalloc/releases/download/4.3.1/jemalloc-4.3.1.tar.bz2 &&\ - tar -xjf jemalloc-4.3.1.tar.bz2 && cd jemalloc-4.3.1 && ./configure && make &&\ - mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc + tar -xjf jemalloc-4.3.1.tar.bz2 && cd jemalloc-4.3.1 && ./configure && make && make install &&\ + cd / && rm -rf /jemalloc RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ - cd /src/ruby-build && ./install.sh &&\ + cd /src/ruby-build && RUBY_CONFIGURE_OPTS='--with-jemalloc' ./install.sh &&\ cd / && rm -rf /src/ruby-build && ruby-build 2.3.2 /usr/local RUN gem install bundler &&\ diff --git a/templates/web.template.yml b/templates/web.template.yml index c4036b9..0f630a2 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -91,7 +91,7 @@ run: # postgres cd $home chown -R discourse:www-data /shared/log/rails - LD_PRELOAD=/usr/lib/libjemalloc.so.1 HOME=/home/discourse USER=discourse exec chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb + LD_PRELOAD=/usr/local/lib/libjemalloc.so.2 HOME=/home/discourse USER=discourse exec chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb - file: path: /etc/service/nginx/run -- 2.25.1