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

Enable puma clustered #654

Merged
merged 2 commits into from Nov 1, 2020

Conversation

brunoocasali
Copy link
Contributor

Based on: #641

This PR just enable the puma clustered mode as discussed in #641 (comment)

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In puma 5 preloading app is the default behaviour

@brunoocasali brunoocasali mentioned this pull request Oct 29, 2020
5 tasks
# process behavior so workers use less memory.
#
# preload_app!
workers ENV.fetch("WEB_CONCURRENCY") { 3 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeeDeeG if you could share with me some data about the workload in production would be nice, and I could help to improve this setup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunoocasali hmm, I don't have access to that data myself.

cc @mi-wood @tkwidmer do you have data about our traffic/resource usage on Heroku?

This pull request is to look at enabling multiple workers/concurrency in Puma. It would be useful to know what our performance needs are. If you have anything relevant to share from the Heroku dashboards, that would be great.

Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you people use any APM will be nice to see them too, like new relic, scout apm or others..

@DeeDeeG DeeDeeG added Hacktoberfest These are issues or pull requests related to Hacktoberfest (https://hacktoberfest.digitalocean.com/) enhancement labels Nov 1, 2020
@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 1, 2020

Merging this to develop branch... this makes the change live on https://staging.refugerestrooms.org, and queues the change for eventually being published to the main site at https://refugerestrooms.org.

I might revert this just before publishing a new release, then revert the revert again so it stays live on staging. That is, I'd like to try this out and be sure it works well for a while before putting this change on the main site. But I'm happy to begin trying it out now!

Thanks again!

@DeeDeeG DeeDeeG merged commit 6c63546 into RefugeRestrooms:develop Nov 1, 2020
@brunoocasali brunoocasali deleted the enable-puma-clustered branch November 1, 2020 20:27
DeeDeeG added a commit to DeeDeeG/refugerestrooms that referenced this pull request Mar 10, 2021
This reverts commit 6c63546.

We don't know for sure that we need these speed/latency gains,
and maintenance bandwidth is low for the project.

We don't want to potentially have to track down bugs,
or undo any damage done, so revert this change for now.
DeeDeeG added a commit that referenced this pull request Mar 10, 2021
This reverts commit 6c63546.

We don't know for sure that we need these speed/latency gains,
and maintenance bandwidth is low for the project.

We don't want to potentially have to track down bugs,
or undo any damage done, so revert this change for now.
@DeeDeeG DeeDeeG mentioned this pull request Mar 10, 2021
5 tasks
DeeDeeG added a commit that referenced this pull request Mar 16, 2021
* Enable puma clustered (#654)

    Enable puma clustered mode to process more requests and reduce latency

* Use a volume to deal with bundled gems (#640)

    This way we don't need to rebuild everytime we add/update/remove a gem

* Improve organization in contact/restroom models (#653)

  * Remove unused git keep from models

  * Improve identation/organization of Contact form

  * Improve Restroom model organization by grouping method kinds

* Update dependencies for early March 2021 (#658)

  * Dockerfile: Update NodeJS to version 14

  * yarn.lock: Bump ini from v1.3.5 to v1.3.8

  * yarn.lock: Bump dompurify from v2.0.8 to v2.2.6

  * Gemfile.lock: Bump nokogiri from 1.10.10 to 1.11.1

  * Gemfile[.lock]: Update rails to v5.2.4.5

      Was version 5.2.4.4 (this is a patch version bump)

  * Ruby: Update from 2.5.8 to 2.6.6

  * Gemfile[.lock]: Update webmock (v3.2.1 to v3.12.1)

      Also update its transitive dependencies,
      within ranges allowed by Gemfile.

  * Ruby: Update from 2.6.6 to 2.7.1

  * Ruby: Update from 2.7.1 to 2.7.2

  * Gemfile.lock: Update puma from 5.0.2 to 5.2.2

  * yarn.lock: Update elliptic from v6.5.3 to v6.5.4

  * Revert "Enable puma clustered (#654)" (#659)

      This reverts commit 6c63546.

      We don't know for sure that we need these speed/latency gains,
      and maintenance bandwidth is low for the project.

      We don't want to potentially have to track down bugs,
      or undo any damage done, so revert this change for now.

Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Hacktoberfest These are issues or pull requests related to Hacktoberfest (https://hacktoberfest.digitalocean.com/) Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants