Sha256: a8ff76afe67915267cc25f323ef40ed2e0042389099a73bf68d4a08c9f5ce2c9

Contents?: true

Size: 963 Bytes

Versions: 1

Compression:

Stored size: 963 Bytes

Contents

[Unit]
Description=sidekiq for <%= "#{fetch(:application)} (#{fetch(:stage)})" %>
After=syslog.target network.target

[Service]
Type=simple
Environment=RAILS_ENV=<%= fetch(:rails_env) %>
WorkingDirectory=<%= fetch(:deploy_to) %>/current
ExecStart=<%= sidekiq_cmd %> <%= process_options(index) %>
ExecReload=/bin/kill -TSTP $MAINPID
ExecStop=/bin/kill -TERM $MAINPID
<%="StandardOutput=append:#{fetch(:sidekiq_log)}" if fetch(:sidekiq_log) %>
<%="StandardError=append:#{fetch(:sidekiq_error_log)}" if fetch(:sidekiq_error_log) %>
<%="User=#{sidekiq_user(role)}" if sidekiq_user(role) %>
<%= "MemoryAccounting=#{ !!max_mem(index) }" if max_mem(index) %>
<%= "MemoryLimit=#{ max_mem(index) }"  if max_mem(index) %>

# Greatly reduce Ruby memory fragmentation and heap usage
# https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
Environment=MALLOC_ARENA_MAX=2

RestartSec=1
Restart=on-failure

SyslogIdentifier=sidekiq

[Install]
WantedBy=default.target

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-sidekiq-systemd-0.2.0 lib/generators/capistrano/sidekiq/systemd/templates/sidekiq.service.capistrano.erb