Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various systemd improvements - Multiple Process Support, Per Process Config, Proper Restarts with timeout and more #279

Merged
merged 9 commits into from
Jul 29, 2021

Conversation

jclusso
Copy link
Contributor

@jclusso jclusso commented Jun 25, 2021

I've tried to cleanup the overall systemd support in this repository. I've merged in a few other contributors PRs (#262 and #265) since they both were of use to me at some point.

Here are the major changes

  • Tried to refactor and cleanup the tasks for managing systemd as a whole.
  • Support for multiple Sidekiq processes via set :sidekiq_processes, 3 which was previously removed I guess. This uses systemd's built in functionality to support multiple processes. The service file gets named sidekiq@.service and then processes are managed using systemctl [command] sidekiq@{1..2}.
  • Updated the systemd template using the official example.
  • Proper Restart Task
    • Runs Quiet (systemctl kill -s TSTP sidekiq@{1..2})
    • Polls status until running workers is 0 or 30 seconds has passed
    • Runs Stop
    • Runs Start.

ayn and others added 6 commits September 11, 2020 14:15
* 'master' of github.com:farnsworth/capistrano-sidekiq:
  added sidekiq_service_templates_path to manage custom systemd templates
* 'master' of github.com:ayn/capistrano-sidekiq:
  Add support for sidekiq_config, sidekiq_concurrency, and sidekiq_queue options for systemd
Updated systemd template using official example from mperham.
Updated readme with commmon undocumented settings and made a note about seeing where more are.
…ript that waits till all workers are done or 30 seconds.
@seuros seuros self-assigned this Jun 25, 2021
…rt and created symlinked config files for each process. Also improved restart to handle each process and fixed errors on log lines.
* per_process_config:
  Refactored per process config to use systemds built in varaible support and created symlinked config files for each process. Also improved restart to handle each process and fixed errors on log lines.
  Per process config v1
@jclusso
Copy link
Contributor Author

jclusso commented Jun 30, 2021

I realized we needed per process configuration support. I'm not sure for certain if this was a thing in the past, but it looks like it has been requested and existed on some other forks.

You can now set an array for sidekiq_config which will then use the configuration file in the array for each specific process (process 1 => item 1, process 2 => item 2,... etc). Raises an error if you don't have the right number of configs for number of processes. If you specify a string for sidekiq_config it will work as expected and use that config for all processes. Also fixed some bugs with log messages during restart and made restart work better overall.

@jclusso jclusso changed the title Various systemd improvements - Multiple Process Support, Proper Restarts with timeout and more Various systemd improvements - Multiple Process Support, Per Process Config, Proper Restarts with timeout and more Jul 1, 2021
@jclusso
Copy link
Contributor Author

jclusso commented Jul 26, 2021

@seuros have you had a chance to look at this?

@seuros
Copy link
Owner

seuros commented Jul 29, 2021

Excellent. Let merge to master and have some time to test it.

@seuros seuros merged commit 21c473b into seuros:master Jul 29, 2021
@jcfjcosta
Copy link

This merge creeped back some bugs that were already fixed (ex: PR #272)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants