1

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?

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
DanteLord
  • 35
  • 3

2 Answers2

1

The thread pool that you create by declaring dubbo:protocol is 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. jstack shows the thread names, most of them you should be able to google and understand their purpose.

Your dubbo thread pool will most likely spawn new threads only when handling the incoming requests.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
0

Here's dubbo thread model(http://dubbo.apache.org/en-us/docs/user/demos/thread-model.html),there is a picture demonstrating dubbo thread model,you can see that only server has a thread pool,which means only dubbo provider has thread pool.because it needs to separate I/O thread from non I/O thread.

jenksding
  • 3
  • 3