A part of my dubbo configuration file:
<dubbo:protocol name="dubbo" dispatcher="all" threadpool="fixed" threads="100" />
According to dubbo documentation the config above means
A fixed size of thread pool and it creates threads when starts, never shut down.
But when I started the application then I use jstack to see if there are more than 100 threads, I found only about 40 threads and I didn't find any dubbo threads. So, what happened?
The thread pool that you create by declaring
dubbo:protocolis not the only source of threads in the JVM. Normally JVM starts a number of utility threads so it can function properly and support various features e.g. finalizers, shutdown hooks, RMI, etc.jstackshows the thread names, most of them you should be able to google and understand their purpose.Your
dubbothread pool will most likely spawn new threads only when handling the incoming requests.