diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index 801e5ae..5fb473b 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -42,7 +42,7 @@ user "mastodon" do end package %w(imagemagick ffmpeg libxml2-dev libxslt1-dev file git curl pkg-config - libprotobuf-dev protobuf-compiler libidn11 libidn11-dev) + libprotobuf-dev protobuf-compiler libidn11 libidn11-dev libjemalloc1) node_package "yarn" do version "1.3.2" diff --git a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb index 6a00a30..02c97c3 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq.systemd.service.erb @@ -9,6 +9,7 @@ User=<%= @user %> WorkingDirectory=<%= @app_dir %> Environment="RAILS_ENV=production" Environment="DB_POOL=50" +Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1" ExecStart=<%= @bundle_path %> exec sidekiq -c 5 -q default -q mailers -q pull -q push TimeoutSec=15 Restart=always diff --git a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb index 5e8e5e9..315c216 100644 --- a/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb +++ b/site-cookbooks/kosmos-mastodon/templates/default/mastodon-web.systemd.service.erb @@ -12,6 +12,7 @@ PIDFile=<%= @app_dir %>/tmp/puma.pid WorkingDirectory=<%= @app_dir %> Environment="RAILS_ENV=production" Environment="PORT=3000" +Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1" ExecStart=<%= @bundle_path %> exec puma -C config/puma.rb --pidfile <%= @app_dir %>/tmp/puma.pid ExecStop=<%= @bundle_path %> exec puma -C config/puma.rb --pidfile <%= @app_dir %>/tmp/puma.pid stop ExecReload=<%= @bundle_path %> exec pumactl -F config/puma.rb --pidfile <%= @app_dir %>/tmp/puma.pid phased-restart