Traccar should be using multiple cores automatically when needed.
In our situation, that does not appear to be the case. One core is under a flat 100% load. How do we troubleshoot?
It depends on the place where it happens. I was talking in general. You can probably check the process using some Java profiling tools to see what's using the CPU time.
Can you tell us if there will be a performance increase, if we force Java to use multiple cores through -XX:ActiveProcessorCount=x
?
I doubt it.
It appears that a nioEventLoopGroup-3-5
thread is taking longer than usual. Do you think it will be possible to switch to EpollEventLoop for the sake of better performance?
It's probably one of the Netty threads, so it doesn't really tell us much because most of the processing is done in those threads.
Okay. How do we diagnose the issue further? What's next?
You need to profile specific classes/methods that take the CPU time. Maybe it's related to computed attributes?
May you suggest a tool to do so?
We ended up using JProfiler. It appears that it is indeed related to computed attributes, as the createScript
function seems to be taking its time.
Question is, why doesn't Java distribute the load to other cores, and if there's actually a reason behind this, is it still possible to compute multiple attributes in parallel, making other cores do work too?
Not sure. I would think that it's happening synchronously on whatever Netty thread it is running on.
Could you please think about rerouting the load to cores equally then? The current implementation is not ideal, with all respect.
I wonder how this relates to horizontal scaling while it seems the server is not able in this case to use all cpu cores on one server?
Hello,
We have noticed that our Traccar uses a single core for computing, so all our other cores have no load. Please let me know if there's a setting to allow multi-core computing, and if there isn't, please say what's better for Traccar:
A. The CPU that has small amount of cores but higher frequency - "числодробилки";
B. The CPU that has more cores, but lower frequency.
If that is B, how do we tell Java to use multiple cores?
Thank you.