Netty's default number of EventLoops

74 views
Skip to first unread message

Piotr Jarzemski

unread,
Sep 22, 2018, 11:02:41 AM9/22/18
to Netty discussions
Hi,

What is the reasoning behind using by default twice more EventLoop's than available logical cores? Honestly, I would expect to rather make it equal to number of CPUs, but I guess I miss some insight.


Best regards,
P.

Norman Maurer

unread,
Sep 22, 2018, 11:04:12 AM9/22/18
to ne...@googlegroups.com
I think thats just for historic reasons when server typically had not more then 8 - 16 cores. In netty 5 we should revisit. How many EventLoops you need highly depend on what you do and I would suggest to profiling it.

Bye
Norman


--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/9711da9a-bab0-45a0-8193-c06c5e3ba84e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ian Barfield

unread,
Oct 5, 2018, 8:29:12 AM10/5/18
to ne...@googlegroups.com
I remember this. There was some mention about it.. probably in an old tutorial or example. It was just a relatively safe default that neither defeated the purpose of using an event loop nor was as likely to produce unexpected results for the more casual or uniquely situated user.

Basically the insight you might be missing is either "default values usually compromise between good and fool proof" or "the amazing variety of (potentially, but maybe not obviously, unreasonable) of situations users will encounter.. is something it is better to experience less of".

(It should go without saying that either 'insight' is not useful as an end user -- end users just need to follow what Norman already said.. this response is solely I guess.. to forcibly depress everyone by reminding them how many variables there still are to experiment on for exactly every program you use -- oh God even whatever email client you see this in. Is it graphics intensive? I mean probably not right.. so maybe renice it to something lower, but it's still user facing and how much waste could it ever cause.. well unless there are settings about preloading images or something.. probably does some search indexing sometimes.. probably why browser based email is so popular huh, although well this is a never ending nightmare. Just keep throwing money at hardware salesmen until no settings matter ever.)

Enrico Olivelli

unread,
Oct 5, 2018, 8:45:23 PM10/5/18
to ne...@googlegroups.com


Il sab 22 set 2018, 17:04 'Norman Maurer' via Netty discussions <ne...@googlegroups.com> ha scritto:
I think thats just for historic reasons when server typically had not more then 8 - 16 cores. In netty 5 we should revisit. How many EventLoops you need highly depend on what you do and I would suggest to profiling it.

Is there any guide, blog post, tutorial....to have some guide for this activity?

It is very difficult, there no recipe....
A generic java profiler does not help, you can run benchmarks with tipical application workloads...but it is not easy to track down performance issues with netty  non blocking, async programming model.
Thanks in advance

Enrico


Bye
Norman


On 22. Sep 2018, at 05:44, Piotr Jarzemski <jarzems...@gmail.com> wrote:

Hi,

What is the reasoning behind using by default twice more EventLoop's than available logical cores? Honestly, I would expect to rather make it equal to number of CPUs, but I guess I miss some insight.


Best regards,
P.

--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/9711da9a-bab0-45a0-8193-c06c5e3ba84e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--


-- Enrico Olivelli

Norman Maurer

unread,
Oct 5, 2018, 11:24:50 PM10/5/18
to ne...@googlegroups.com
Sorry no... a java profiler should give you clues. Like how often does it block for IO to be ready and how many pending tasks are in the task queue. 
Reply all
Reply to author
Forward
0 new messages