15
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ruby公式Dockerイメージにjemallocを導入する方法

Last updated at Posted at 2020-05-07

経緯

  • Ruby公式Dockerイメージで立てたサーバで、メモリ消費量が増加してpumaが勝手に再起動してサービスが瞬断することが発生するようになった
  • その対策として、メモリ領域の断片化を減らしてくれるjemallocを導入した

導入方法

以下を追記

Dockerfile
FROM ruby:2.4.2

RUN apt-get update && apt-get install -y libjemalloc-dev libjemalloc2
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

※ 以前はパッケージの名前libjemalloc1だったが、今はlibjemalloc2に変更になっていた

参考

15
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?