Project

General

Profile

Actions

tickets #181643

closed

Switch Redmine to Puma

Added by crameleon 19 days ago. Updated 11 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Redmine
Target version:
-
Start date:
2025-04-30
Due date:
% Done:

0%

Estimated time:

Description

Currently Redmine on progress.o.o runs with Unicorn. Puma is more modern and, going by short research in online forums, might help prevent slowdown and intermittent DoS we observe with request spikes lately.
We already include Puma with our Redmine package (it was used years ago, but the changelog does not explain why it was switched back to Unicorn - whatever the reason might have been, it's probably no longer relevant nowadays, Puma seems to be a commonly used web server with Redmine nowadays), so all it should need is adjusting the service unit file and AppArmor profiles. Afterwards Unicorn can be removed from the custom Gemfile and package requirements.

Actions #1

Updated by crameleon 19 days ago

  • Private changed from Yes to No

FWIW I also investigated Passenger, but we don't have any existing Passenger deployment and it would require setting up a httpd and likely bigger refactoring the AA profiles to make use of hat instead of process confinement.

Actions #2

Updated by crameleon 11 days ago

  • Status changed from New to In Progress
  • Assignee set to crameleon
Actions #3

Updated by crameleon 11 days ago

So whilst that worked great in my test setup, in production it is atrociously slow compared to the previous Unicorn setup. I am trying with workers 2 and threads 2 which seems to be the recommendation with 2 cores (I also tried with threads 4 which is the result of the recommended calculation when migrating from Unicorn but that seemingly just caused more load).

Actions #5

Updated by crameleon 11 days ago · Edited

It's quite usable now indeed, but I think about doubling the CPU cores to allow for more workers:

https://gitlab.infra.opensuse.org/infra/salt/-/merge_requests/2459

Actions #6

Updated by crameleon 11 days ago

Following https://puma.io/puma/file.deployment.html again and this time ignoring the "Migrating from Unicorn" section and instead following "MRI", I changed threads to the default of 5 (upon reading further, one thread executes Ruby code at a time, so the threads limit concurrent requests, making the Unicorn calculation of 2 indeed quite limiting) via https://build.opensuse.org/package/rdiff/openSUSE:infrastructure:redmine/redmine?linkrev=base&rev=89 - this makes it much more snappy. I will still pursue the increase of cores/workers as it's a reasonably minor increase of resources giving more room for request spikes (the load can be seen to jump up every so often).

Actions #7

Updated by crameleon 11 days ago · Edited

  • Status changed from In Progress to Resolved

Done as well: https://progress.opensuse.org/projects/opensuse-admin/repository/salt/revisions/2da01001904e665af5ff450832af5f4160d6291e (and adjusted puma.rb to automatically set worker count to CPU count).

Actions

Also available in: Atom PDF