diff --git a/site-cookbooks/kosmos-mastodon/attributes/default.rb b/site-cookbooks/kosmos-mastodon/attributes/default.rb index 88e323e..e2580ed 100644 --- a/site-cookbooks/kosmos-mastodon/attributes/default.rb +++ b/site-cookbooks/kosmos-mastodon/attributes/default.rb @@ -1,5 +1,6 @@ -node.default["kosmos-mastodon"]["directory"] = "/opt/mastodon" -node.default["kosmos-mastodon"]["puma_port"] = 3000 -node.default["kosmos-mastodon"]["streaming_port"] = 4000 -node.default["kosmos-mastodon"]["server_name"] = "kosmos.social" -node.default["kosmos-mastodon"]["redis_url"] = "redis://localhost:6379/1" +node.default["kosmos-mastodon"]["directory"] = "/opt/mastodon" +node.default["kosmos-mastodon"]["puma_port"] = 3000 +node.default["kosmos-mastodon"]["streaming_port"] = 4000 +node.default["kosmos-mastodon"]["server_name"] = "kosmos.social" +node.default["kosmos-mastodon"]["redis_url"] = "redis://localhost:6379/1" +node.default["kosmos-mastodon"]["sidekiq_threads"] = 25 diff --git a/site-cookbooks/kosmos-mastodon/recipes/default.rb b/site-cookbooks/kosmos-mastodon/recipes/default.rb index 1d12473..baeb5b3 100644 --- a/site-cookbooks/kosmos-mastodon/recipes/default.rb +++ b/site-cookbooks/kosmos-mastodon/recipes/default.rb @@ -154,7 +154,8 @@ application mastodon_path do source "mastodon-sidekiq.systemd.service.erb" variables user: user, app_dir: mastodon_path, - bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle" + bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle", + sidekiq_threads: node["kosmos-mastodon"]["sidekiq_threads"] notifies :run, "execute[systemctl daemon-reload]", :delayed notifies :restart, "service[mastodon-sidekiq]", :delayed end 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 02c97c3..1f5f491 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 @@ -10,7 +10,7 @@ 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 +ExecStart=<%= @bundle_path %> exec sidekiq -c <%= @sidekiq_threads %> -q default -q mailers -q pull -q push TimeoutSec=15 Restart=always