XF 2.1 What is xf-rebuild:threads really doing?

Improvs

Member
Hi, can anyone explain me what rebuild threads job realy do?
I got a problem, my server doing all kinds of rebuild job very very... slow (using CLI) and we can't find a reason with system administrator.

So, We're trying to understand what kind of processes this job do.
The same problem with rebuild phrases, it can took several hours.
We didn't have such problem recently, we didn't make any changes on server configuration.
 
xf-rebuild:threads is something that has to be run manually on the command line. There's nothing in XF that would trigger it automatically.

It is the same rebuild that runs if you run it from Tools > Rebuild caches > Rebuild threads which, again, has to be manually run from there.

If you are seeing that run routinely and you are not intending to run it yourself then it implies there is something automatically triggering it, either on the server itself via a system cron or an add-on is triggering it through code for some reason.

Phrase rebuild will run a little more routinely but we only trigger it if you make phrase changes to a language that has child languages, or if you install/change an add-on that adds phrases. We also trigger it if you install/upgrade XF.

But, again, these things aren't something that would generally run without some specific action. It can take a while when it does run depending on how many languages and templates you have.

Hope that helps track it down. Honestly, I'd start by looking at any add-ons you added recently in case they have a need to run these routinely for some reason.
 
My problem is slow request processing.
As example, recently (1 week ago) it takes 10-20 seconds to rebuild phrases due importing. But currently it takes about 10-15 minutes to rebuild phrases. I have only 2 languages installed.

The same problem due threads rebuilding via CLI, it can take several hours to rebuild them all. (one step about 100-250 threads, total threads 150 000). Recently step was 1000 -1200 and it takes no more then 10 minutes.

Server "top" command Load Avarage: 0.7-1 max. 6 cores, 16gb memory. (fastcgi+apatch, php 7.3. )
Database location on another server. Also 6 corse, 16gb memory. Load Avarage 0.2-0.5 : perfect.
So, it is not clear what started to slow down requests. Usually we look at the load avarage and draw conclusions
 
My problem is slow request processing.
As example, recently (1 week ago) it takes 10-20 seconds to rebuild phrases due importing. But currently it takes about 10-15 minutes to rebuild phrases. I have only 2 languages installed.

1.) Does it have to be swapped out of the RAM memory onto the disk?
2.) Is the hard drive too full?
3.) Is the hard drive ok?
4.) Have there been changes to the cache or database server (settings)?

That's when I would start to localize the problem.
 
Rather than start a new thread, I too would like to know what xf-rebuild:threads does.

Is it just to rebuild the thread cache (replies, last post etc) or is there more to it than that?
 
That’s about it.

There‘s an optional rebuild post position counters option which rebuilds all of the post position numbers in each thread (the number in the top right of each post). It’s very rare that this is needed but can fix issues caused by manual database queries or other bugs which might cause them to go out of order.
 
Back
Top Bottom