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

consider more unicorn workers #298

Open
vmpjdc opened this issue Oct 24, 2024 · 2 comments
Open

consider more unicorn workers #298

vmpjdc opened this issue Oct 24, 2024 · 2 comments
Assignees

Comments

@vmpjdc
Copy link

vmpjdc commented Oct 24, 2024

Enhancement Proposal

We've found that some of our busier Discourse deployments need quite a few Juju units to keep up with the traffic.

The charm starts 3 unicorn workers, and since unicorn also needs to be able to respond to pebble checks, each unit on average can handle a little under 3 concurrent user requests. Every unit also runs a few other things (sidekiq, monitoring, etc.) and this fixed overhead adds up.

It would be nice if each unit started more unicorn workers, although since it seems the guidance (for example) generally boils down to:

  1. no more than 2 workers per real CPU core; and
  2. as many workers as you need,

perhaps this is one of the rare cases where a charm setting makes sense.

@cbartz
Copy link
Contributor

cbartz commented Nov 5, 2024

@nrobinaubertin Can you please check if this is possible and create a jira ticket if possible?

@nrobinaubertin
Copy link
Collaborator

nrobinaubertin commented Nov 5, 2024

I moved the automatically created ticket to the right place (ISD-2580).

For future reference:

The number of workers is controlled by the following line in /srv/discourse/app/config/unicorn.conf.rb in the container:

worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i

The best is probably to add a parameter here: https://github.com/canonical/discourse-k8s-operator/blob/main/src/charm.py#L416

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

No branches or pull requests

3 participants