Does high QPS against Workflow's Query methods effect thread count limit?

Hi,

I was wondering if there would be concerns if a workflow’s query method is called a lot . I’m not sure if this is related, but I’ve noticed the temporal queue size increase to a point where I run out of threads. I was wondering if this could be attributed to the QPS of the query method.

Also this is might be a dumb question, but what is the number of current worker threads based off of. For example, I’m guessing I can’t use java.lang.Thread.activeCount() to determine what the current thread count is for the workers. It’ll be nice to be able to track this or print it out.

Thanks,
Derek

What is the indication that you are running out of threads? Is latency increased or do you see some exceptions?

Sorry didn’t see the response. But I get the following exception. I’m trying to figure how to translate this active thread count into a metrics which I can trigger an alert if it gets close to the max pool size.

io.temporal.internal.sync.WorkflowRejectedExecutionError: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@2053d445[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@71f6e85c[Wrapped task = io.temporal.internal.sync.WorkflowThreadImpl$RunnableWrapper@1568b1e]] rejected from java.util.concurrent.ThreadPoolExecutor@10d53f40[Running, pool size = 600, active threads = 600, queued tasks = 0, completed tasks = 4199]