# Browser upgrade fails when discourse is configured to use one unicorn worker

**URL:** https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562
**Category:** Bug
**Created:** [October 17, 2023, 6:48pm UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562 "2023-10-17T18:48:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [October 17, 2023, 6:48pm UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562/1 "2023-10-17T18:48:47Z")

</div>

Linked to the posts here where it was suggested this may be a bug.

> [@Builds taking very long time](https://meta.discourse.org/t/builds-taking-very-long-time/217001/23):
>
> This seems like a bug, especially as the system cuts down to a single unicorn temporarily very shortly afterwards. The number 2 is hardcoded, as is the number 1 for the reduction. Edit: looks like this change introduced the inconsistency [https://github.com/discourse/docker\_manager/commit/8bfea831c7b423d26d85585f9a3d7301d58e00ae](https://github.com/discourse/docker_manager/commit/8bfea831c7b423d26d85585f9a3d7301d58e00ae) I think your post (and this reply) should be a in a new thread, in the bugs category.

> [@Builds taking very long time](https://meta.discourse.org/t/builds-taking-very-long-time/217001/22):
>
> I’m also going to add more to this, I’m running a lean system (1GB ram) and a small site. It has 2 unicorn workers and between them each was taking up 30% of the memory which was causing a lot of [memory thrashing](https://meta.discourse.org/t/limiting-the-number-of-unicorns-memory-usage-and-swapping/274954), so I decided to cut down the number from 2 to 1 (which I believe can handle about 10 concurrent connections each). This made a HUGE difference and made the page loads almost instantaneous and reduced swapping by a factor of 5-10 (depending on what was being loaded). The downside that …

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [October 17, 2023, 8:48pm UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562/2 "2023-10-17T20:48:17Z")

</div>

Let me redo my response here:

> [@Builds taking very long time](https://meta.discourse.org/t/builds-taking-very-long-time/217001/22):
>
> ABORTING, you do not have enough unicorn workers running

This seems like a bug, especially as the system cuts down to a single unicorn temporarily very shortly afterwards.

The number 2 is hardcoded, as is the number 1 for the reduction.

> <https://github.com/discourse/docker_manager/blob/main/lib/docker_manager/upgrader.rb#L37C1-L41C1>

Edit: looks like this change introduced the inconsistency  
[https://github.com/discourse/docker\_manager/commit/8bfea831c7b423d26d85585f9a3d7301d58e00ae](https://github.com/discourse/docker_manager/commit/8bfea831c7b423d26d85585f9a3d7301d58e00ae)

Thanks for the new thread.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 18, 2023, 12:50am UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562/3 "2023-10-18T00:50:04Z")

</div>

Yeah I just don’t think we can support this, the bug fix here will be simply to make it impossible to happen, not fix the upgrade code.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [October 18, 2023, 8:01am UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562/4 "2023-10-18T08:01:44Z")

</div>

> [@sam](#):
>
> make it impossible to happen

Make what impossible? Setting a single unicorn? And yet such a setup worked better for the OP, until the upgrade.

And because the upgrade drops the number of unicorns to 1, it seems clear to me that 1 unicorn is enough at the time of an upgrade.

Have you looked at the history of this bit of code?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 18, 2023, 8:36am UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562/5 "2023-10-18T08:36:34Z")

</div>

No just make it impossible to upgrade via the ui if you only have 1 unicorn

Force you to rebuild from console, memory is too constrained anyway

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [October 18, 2023, 3:19pm UTC](https://meta.discourse.org/t/browser-upgrade-fails-when-discourse-is-configured-to-use-one-unicorn-worker/282562/6 "2023-10-18T15:19:54Z")

</div>

Fair enough - I’ve resorted to always using the console these days, on my memory-limited instances.
