2

WSO2 ESB is not loading all proxies (more than 20). Then we increased following two values in the startup script and it worked:

-Dsnd_t_core=120
-Dsnd_t_max=600

But then we encountered several fatal issues of the WSO2 ESB. Several JMS proxies were blocked and did not consume anymore messages. The worst thing of all: NO ERROR in the carbon.log!

In addition the CPU load on the server went up to 100%.

A restart did not solve the problem, only deactivating scheduled tasks or proxies solved the problem.

We now discovered, that a VFS proxy is creating exactly 120 threads (JConsole). With each transport.PollInterval it creates a new Thread.

Which values do you use for the -Dsnd_t_core and max?

Why is a VFS proxy creating a new thread (see jconsole) a t each PollInterval?

Community
  • 1
  • 1
Philipp
  • 4,645
  • 3
  • 47
  • 80

1 Answers1

1

As long as I know, WSO2 ESB thread is based on java.util.concurrent ThreadPool.

In this link you can read about some ThreadPool characteristics like when will it create a new thread, the queue mechanism, and reject task policy.

Which values do you use for the -Dsnd_t_core and max?
-Dsnd_t_core is the minimum number of threads inside a ThreadPool. So WSO2 ESB will automatically create thread as much as you set the -Dsnd_t_core. The default value is 20. WSO2 ESB will create 20 vfs-worker if you don't specify the -Dsnd_t_core.
-Dsnd_t_max is the maximum number of threads inside a ThreadPool. WSO2 ESB will stop create a new thread if the maximum number is reached.

Why is a VFS proxy creating a new thread (see jconsole) a t each PollInterval?
WSO2 ESB will create a new thread in these conditions :

  • If fewer than corePoolSize threads are running, the Executor always prefers adding a new thread rather than queuing.
  • If corePoolSize or more threads are running, the Executor always prefers queuing a request rather than adding a new thread.
  • If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize, in which case, the task will be rejected.

So, as long as your queue is full and the maximum number of threads is not reached, WSO2 will create a new thread to handle a process. The PollInterval is set to specify the delay before your service start to poll the message or file from the source folder.

You can set the maxQueue number to unbound (-1) so the queue will never full and new thread will never be created.

I also found something from the JConsole. 1 service/1 proxy service will be handled only by 1 thread. I still trying to figure this out and make 1 service/1 proxy service is handled by 2 or more thread (multithread).

Hope this will help answer your question :)

Mari_Yaguchi
  • 477
  • 8
  • 25
  • Nice answer and seems logic. But one thing I don't understand, it creates a new thread at each PollInterval even if the queue is empty - that's strange. And theses threads will then be in the WAIT mode and continue existing, even if they never had a message... – Philipp Apr 09 '13 at 08:22