Ratpack talk - The story so far
I recently gave a talk to developers at Sky where I am currently working with Energized Work on the subject of our team's experience with Ratpack.
Apologies for the technical issue half way through (and also for the huge number of erms and ers).
Hello.
ReplyDeleteI have seen the record of this talk on youtube and it was very interesting for me.
So, there was some question at 54:18 (link for it https://youtu.be/q2vADSqi6XI?t=3257 ) and i could not understand what it was about (could not hear it).
Could you repeat that question and answer for it here, please?
Hi Djasan,
DeleteGlad that you found the talk interesting.
The question was "Why does ratpack default the number of threads to two times the number of CPU cores?".
...I had a quick check and yes indeed it does default to two threads per CPU core - see here: https://ratpack.io/manual/current/api/ratpack/server/ServerConfig.html#DEFAULT_THREADS
My answer was "I don't know". I then went on to guess that perhaps a little bit of thread switching is ok (i.e. one cpu core switching between two threads of execution is better for performance - however in retrospect this seems wrong as the entire idea is thread switching is to be avoided).
Someone else from the audience then said (it was very muffled so might be wrong here...) that it might be due to the fact that some CPUs will perform hyper-threading on each core which means a single core could perform more than one task in parallel. See wikipedia here: https://en.wikipedia.org/wiki/Hyper-threading
If you are really thinking about performance (likely if you're using ratpack) perhaps the best bet is to adjust this property based on what (if any) hyper-threading your CPU will do.
Hope this helps.
Phill
Hi Phill,
ReplyDeletethanks for a great presentation! I am quite curious about the way who you've tested the performance. Could you please provide a bit more information (about an environment, HW, etc..)
Thanks!