This message was deleted.
# community-help
s
This message was deleted.
k
Hi Jessica, indexing time is a function of the number of fields, types of fields and length of fields indexed. The large startup indexing time on restart is a trade-off we have chosen while designing Typesense since it allows us to not hit disk during searching or during live writes. I recommend running a HA cluster so that you can do upgrades one node at a time.
j
Oh.
Out of curiosity, why does adjusting / increasing
num-documents-parallel-load
not appear to be having any impact?
k
Did you also increase the
--thread-pool-size
?
Default is 8 * number of cores. So it's possible that without increasing that increasing num docs parallel is not sufficient.
j
No, because I only have 12 threads available on my system. The default saturates every CPU and slows the system down. I’ve tried decreasing it to no affect. Do you think I should try increasing it to more than the default?
Default, startup logs show
Thread pool size: 96
.
k
Yes 12 * 8 so 96 threads. Indexing is also parallelized on the number off fields in each collection. So with 15 collections, 96 / 15 = 6 fields per collection can be indexed in parallel. If there are more fields, then it will be thread starved.
j
Oh. Even though every CPU has 100% utilisation? What setting would you recommend for
thread-pool-size
? Is it worthwhile to also decrease
num-collections-parallel-load
to
1
at the same time? Is it possible to also prioritise the loading of a particular collection first?
So with 15 collections, 96 / 15 = 6 fields per collection can be indexed in parallel
Didn’t realise that’s how it worked.
k
It's difficult to say what will work because of the number of parameters involved here as it's also influenced by the shape of the data. However, the general rule of thumb is that if CPU is idle increase threads and increase num coll parallel. But if CPU is pegged to 100% then that could also mean too many context switching. It's not possible to control the order of collections that are loaded.
j
Okay, thank you. I increased the thread-pool-size argument to 384 (12 * 32), and now the CPUs aren’t saturated (seems to be 100% for a few seconds, then drops to 10% for a little bit, and repeat..). Does this indicate I should be able to safely increase the thread-pool-size argument even more?
I also lowered
num-collections-parallel-load
as well to
1
.
k
Reducing num collections parallel load to 1 is probably not optimal. Maybe use a value of 4.
Also maybe if you can DM me your schema I can see if there is something you can do to optimize
210 Views