# Very slow sidekiq 5 processed per minute

**URL:** <https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752>\
**Category:** Product Support\
**Created:** [November 20, 2020, 2:53pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752 "2020-11-20T14:53:37Z")\
**Posts on this page:** 16\
**Page:** 1

## AI-generated summary

Christian_Suntay is experiencing very slow Sidekiq processing (5 jobs per minute) and seeks advice on speeding it up. [pfaffman](/t/-/170752/2) suggests increasing the `UNICORN_SIDEKIQS` environment variable to run more Sidekiq processes, depending on system resources like CPU, RAM, and database speed — noting it’s safe to experiment since the import will restart. Christian_Suntay asks if setting `UNICORN_SIDEKIQS` to "8" would help, but [IAmGav](/t/-/170752/5) warns that setting it too high could crash the system if resources are insufficient. Christian_Suntay mistakenly believed "0" was the default, citing `lib/tasks/qunit.rake`, but [merefield](/t/-/170752/9) clarifies that file is for frontend unit tests and unrelated to production. Merefield advises setting the variable in `app.yml`, but Christian_Suntay reveals he’s not using Docker. [pfaffman](/t/-/170752/13) advises against switching to Docker mid-import. Finally, [RGJ](/t/-/170752/15) confirms that `UNICORN_SIDEKIQS` can be manually set as an environment variable and Unicorn restarted — even without Docker — to potentially improve Sidekiq performance.

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 20, 2020, 2:53pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/1 "2020-11-20T14:53:37Z")

</div>

Any idea or tips that could speed up the process?

 ![Screen Shot 2020-11-20 at 10.53.00 PM](https://global.discourse-cdn.com/meta/original/3X/9/c/9c3f46b487acb0f947c10a0d1af87dd5f7fd1311.png)

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [November 20, 2020, 5:45pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/2 "2020-11-20T17:45:03Z")

</div>

If you have lots of cores and ram you can tweak the env variable `UNICORN_SIDEKIQS` to a bigger number when you crank up `./bin/unicorn` (I think it should work for `./bin/rails` as well). Just how big depends on CPU cores, ram, database speed, and so on. You’ll need to experiment to find the best value. You can search for some more info here, but this is the basic idea.

And since you’re going to start from scratch again when you do the next import, it doesn’t matter that much right now. 🙂

---

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 21, 2020, 5:57pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/3 "2020-11-21T17:57:59Z")

</div>

Hi Pfaffman,

“UNICORN\_SIDEKIQS” =\> “0” this is the default

by making it “UNICORN\_SIDEKIQS” =\> “8” will speed up the sidekiq?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [November 21, 2020, 6:03pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/4 "2020-11-21T18:03:03Z")

</div>

I’m not quite sure. Try and let us know!

---

<div class="post-metadata">

**Author:** ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)\
**Post date:** [November 22, 2020, 9:58am UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/5 "2020-11-22T09:58:42Z")

</div>

> [@Christian\_Suntay](#):
>
> “UNICORN\_SIDEKIQS” =\> “0” this is the default

This is not the default

> [@Christian\_Suntay](#):
>
> by making it “UNICORN\_SIDEKIQS” =\> “8” will speed up the sidekiq?

if your system cant handle it, it will crash.

> [@pfaffman](#):
>
> Just how big depends on CPU cores, ram, database speed, and so on

Like he said, it depends on CPU and all those things

---

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 22, 2020, 1:54pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/6 "2020-11-22T13:54:16Z")

</div>

“UNICORN\_SIDEKIQS” =\> “0” i mean it is default in discourse tho

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [November 22, 2020, 3:02pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/7 "2020-11-22T15:02:52Z")

</div>

I can’t see that as the default. Where are you seeing that?

If you’ve set this to zero that might be the root of your issue?

If you set this too high the OS might run out of memory and will start killing processes as per @IAmGav

---

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 22, 2020, 4:07pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/8 "2020-11-22T16:07:46Z")

</div>

> [@Christian\_Suntay](#):
>
> “UNICORN\_SIDEKIQS” =\> “0”

I saw it in lib/tasks/qunit.rake

how do i set it tho?

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [November 22, 2020, 4:11pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/9 "2020-11-22T16:11:14Z")

</div>

That’s stopping sidekiq during a unit test case run. Qunit is a unit test framework for the front end. Nothing to do with production.

You should be able to set it in app.yml. Have you tried that?

---

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 22, 2020, 4:46pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/10 "2020-11-22T16:46:20Z")

</div>

sorry to ask this. where is app.yml located?

---

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [November 22, 2020, 4:46pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/11 "2020-11-22T16:46:39Z")

</div>

Are you running a docker instance?

---

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 22, 2020, 4:47pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/12 "2020-11-22T16:47:50Z")

</div>

sadly no ☹ should i create a app.yml?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [November 22, 2020, 4:51pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/13 "2020-11-22T16:51:37Z")

</div>

You are running a development site for your import. Unless you want to start over and rerun the import you don’t want to switch to the docker install just yet.

---

<div class="post-metadata">

**Author:** ![Christian\_Suntay](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/christian_suntay/32/199290_2.png) [@Christian\_Suntay](https://meta.discourse.org/u/Christian_Suntay)\
**Post date:** [November 23, 2020, 10:54am UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/14 "2020-11-23T10:54:44Z")

</div>

is there any way to make the sidekiq faster without switching to docker yet? Thanks Jay!

---

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [November 23, 2020, 12:21pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/15 "2020-11-23T12:21:07Z")

</div>

You should be able to set the environment variable `UNICORN_SIDEKIQS` manually if you’re not using Docker. Then restart Unicorn.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [December 23, 2020, 12:31pm UTC](https://meta.discourse.org/t/very-slow-sidekiq-5-processed-per-minute/170752/16 "2020-12-23T12:31:58Z")

</div>

Closed on December 23, 2020, 12:31pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
