Too many oneboxes in replies is overloading our Discourse server

My forum is: Education.
A large number of readers (students) created Onebox,
As a result, our Sever CPU is overloaded, the website has 2 errors: 502 Bad Gateway and 504 Gateway Time-out error, unable to access the website.
I want to find the solution: Reduce the frequency (reduce the speed) of Onebox creation in Discourse (Onebox is still being generated, but the time it takes to create consecutive oneboxes will be longer).
If we can prolong the creation time of Oneboxs, then our server CPU will not be overloaded.
Thank you.

1 Like

The easiest thing is likely to increase the ram and or cpu on your server. What are your server specs? How many posts are created each day?

2 Likes

A large number of students make a lot of oneboxes, we have about 10000 students,
I also thought of solutions: Increase CPU, Ram,
However when we tested the CPU, the performance averaged between 25-45%; In some time, our Discourse gets CPU overload, resulting in inaccessibility to our website.
So I wanted another solution,
Jay Pfaffman, Thank you !!!

2 Likes

Did you adjust the memory parameters after adjusting the memory? It sounds like the database is your bottleneck. There are some topics about tuning large servers. That’s where to look.

You can look at the sidekiq queue and see if perhaps those jobs should be in a lower priority queue, but I think database tuning is probably where to look.

2 Likes

We are also facing the same problem, sidekiq ( low) runs fast, causing our discourse to fail to access the website.
Is there a way to adjust sidekiq frequency (low)

I think your options are to add cpu and ram or limit how many links users can make.

1 Like

my problem is almost similar,

In sidekiq, how to reduce the frequency of running sidekiq.
Pictures below:

We want to reduce the frequency of running Low in sidekiq.
Because Low in sidekiq runs too fast (high frequency), causing website errors, readers cannot visit website (502, 504).
I want to specify Sidekiq: Sidekiq (Low) is only allowed to run with how many requests/second
Can you that help me?

for me the CPU, Ram is not high.
With my sidekiq, Low (sidekiq) runs too fast. Make the website fail

As far as I know, sidekiq is not customizable.

With those numbers that you are showing, I would suggest you upgrade your server with more memory & processes.

1 Like

Looking at the sidekiq product level feature chart two things jump out:

  • the basic OSS tier bundled free with Discourse lacks:

    1. rate limiting (which I believe is what you are after?)
    2. batches (which you might use to do work outside of busy user periods for those jobs you could defer)

As such I think you need to look at the hardware side.

However it would be interesting to know if some sites could upgrade to Pro and how much work would be involved (is it just adding a licence key?) Perhaps someone has attempted this before?

The Pro product is not cheap though at $99/month. Makes a case for spending a lot more on hardware? Even $50/month might buy you a significant hardware upgrade? How much are you spending now?

If you want to look at using the Pro product with Discourse that’s something Pavilion could help you with, but that consulting would also cost.

Then there’s always the option of getting someone to host it for you and take on all those challenges.

I think you are going to need to increase your budget significantly in order to run the system the way you want it to work.

3 Likes

Can you provide some data? How many oneboxes per reply, how many replies per topic, and how many oneboxes total per topic?

2 Likes