Question
Morgan Stanley
IN
Last activity: 22 Nov 2018 23:58 EST
What is the purpose of agent/threadpoolsize
What is the purpose of agent/threadpoolsize?
I did go through several articles but its not clear as to what the setting is
is it:
1. The number of agents that can run simultaneously
2. The number of child requestors that any agent can trigger at any point
***Edited by Moderator Marissa to update platform capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Morgan Stanley
IN
Also in Queue instruction https://community.pega.com/sites/default/files/help_v81/procomhelpmain.htm#methods/queue/queue.htm
what do we mean by "The Queue instruction uses a Java thread from a limited thread pool. If using the queue instruction, set the agent/threadpoolsize value in the prconfig.xml file"
Pegasystems Inc.
IN
Agent and Batch requestors both use available threads to run. This setting controls the number of available Java threads on which agents and batch requestors may run.
When you queue some activity using Queue instruction or queueBatchActivity method. It is run by a batch requestor in back-end. This setting controls the limit on batch requestor threads.
Let us know if this clarifies or if you need more help :)
Morgan Stanley
IN
Thanks for the reply pankaj.
Need some more clarification.
Lets suppose i have 100 standard agents configured on a machine which run at same time. I have configured threadpool size to 5.
Does that mean that only 5 standard agents will run at a time..
Each agent usually creates some child threads limiting to threadpool size and simultaneously processes queue items. That mean total number of
threads = 100 agents X 5 threads => 500 threads?
PEG
GB
The agent/threadpoolsize simply defines the number of java threads which will running concurrently.
When an agent tries to process a task it will request a free thread from the agent/threadpoolsize allocation. And when it's action has completed it will release the thread back.
But this doesn't mean one agent will have 1 thread.
Say, for instance, you're not running any agents at all. And then 8 users decide to send a single email each. Then this would create 8 entries in the PR_SYS_QUEUES table.
Now if you start the SendCorr agent it will retrieve these 8 records and attempt to process them concurrently.
If you are running with the default agent/threadpoolsize size (I believe this is 5) then you should see 5 threads are then allocated to send the first 5 emails. And as one thread completes its task, it will be freed up and then the SencCorr agent will take it again to process one of the remaining 3 emails.
The agent/threadpoolsize simply defines the number of java threads which will running concurrently.
When an agent tries to process a task it will request a free thread from the agent/threadpoolsize allocation. And when it's action has completed it will release the thread back.
But this doesn't mean one agent will have 1 thread.
Say, for instance, you're not running any agents at all. And then 8 users decide to send a single email each. Then this would create 8 entries in the PR_SYS_QUEUES table.
Now if you start the SendCorr agent it will retrieve these 8 records and attempt to process them concurrently.
If you are running with the default agent/threadpoolsize size (I believe this is 5) then you should see 5 threads are then allocated to send the first 5 emails. And as one thread completes its task, it will be freed up and then the SencCorr agent will take it again to process one of the remaining 3 emails.
But returning to your question about configuring this to a much higher value, and whether this is advisable or not.
I would image if you have reasonably efficient agent activities then most of these allocated threads would be idle all of the time. And in the worst case scenario (where all are active with some task) this will naturally put some overhead on your application server in terms of CPU and memory.
Unfortunately I don't have any kind of ballpark figure to suggest how best to size this.
-
Wael Bouslama
Morgan Stanley
IN
Thanks Laurence.
That mean at any point the number of queue items being processed is limited to the thread pool size?
If there are multiple agents running simultaneously.. one has to wait for the other to release thread.
Does the number of child requestors triggerd by a parent requestor (run in parallel or queue) also depend on this setting. I mean if i trigger a queue method instruction one thread is busy processing my Queue method activity.. (threadpool size -1) agents running will have to wait for it to release?
Morgan Stanley
IN
Similar to my question:
https://community.pega.com/support/support-articles/pega-creating-maximum-5-batch-requestors-time
-
Venkata Krishna Rajesh Karumuri Saurabh Gupta Sudit Sengupta Sam mk Jinath Wijesinghe and 3 More