Wildfly - Managed Scheduled Executor Threads in Kubernetes

Viewed 104

I'm using Wildfly application server (v. 23.0.1), deployed in a pod inside a Kubernetes cluster. In my app, I am using ManagedScheduledExecutorService to start different Kafka Consumers in separate threads. I have noticed a strange behaviour:

In k8s setup, it seems that I can have at most 2 threads up and running. No matter how many threads I specify in core-threads argument inside standalone-full.xml, the app can support only 2 threads. As a result, I can use at most 2 different Kafka consumers.

When I deploy locally the same app (dockerized only) it seems that I can use much more threads (tested up to 9 separate threads so far).

So is there something in Kubernetes that limits managed-scheduled-executor number of threads (I have read that core-threads = 2*processors), a matter of resources maybe? If nothing could be done on the subject, is there any other thread-pool similar to managed-scheduled-executor that could do the job?

0 Answers
Related