How to increase the Thread Pool Size

210 views
Skip to first unread message

Karimullah Syed

unread,
Mar 2, 2022, 12:59:53 AM3/2/22
to jPOS Users
Hi JPOS Team,

Hope Doing Good.
While doing the load testing we are facing the Thread pool Exhausted issue request you please assist me on this.

<thread-pool name="ThreadPool-2-3">
  <jobs>100</jobs>
  <size>100</size>
  <max>100</max>
  <active>100</active>
  <idle>0</idle>
  <active>100</active>
  <pending>0</pending>
</thread-pool>


For the above issue i have modified the below 00_logger.xml file but still my changes or not reflected.

  <log-listener class="org.jpos.util.BufferedLogListener">
    <property name="max-size" value="200" />
    <property name="name" value="logger.Q2.buffered" />
  </log-listener>

Is the above changes we have done is correct ?Need your assistance.

I have attach ThreadPool.java File in this Default Thread Pool Size defines as 100.

    public static final int DEFAULT_MAX_THREADS = 100;

Can i customize  DEFAULT_MAX_THREADS = 100 to  DEFAULT_MAX_THREADS = 200

What will be the impact on the application could you please suggest us.


Thanks,
Karimullah Syed.



00_logger.xml
ThreadPool.java

murtuza chhil

unread,
Mar 2, 2022, 1:38:08 AM3/2/22
to jPOS Users

Where have you configured ThreadPool? Wherever it's used it has used up all the threads.
What made you change the logger xml? How did you determine the threadpool warning is related to the logger?

Why do you want to change the max in ThreadPool.java when the constructor allows it to be configured? You basically need to figure out where the  ThreadPool is configured and configure it correctly.

As an example you can refer to the jpos programmers manual section on QServer where a threadpool is configured using the min and max session.


<server name="my-server" class="org.jpos.q2.iso.QServer" logger="Q2">
  <attr name="port" type="java.lang.Integer">44444</attr>

<attr name="minSessions" type="java.lang.Integer">10</attr>

<attr name="maxSessions" type="java.lang.Integer">250</attr>

...
...
..
</server>

-chhil

Karimullah Syed

unread,
Mar 8, 2022, 12:57:33 AM3/8/22
to jPOS Users
Hi Chhil,
Thanks you for the response.

<?xml version="1.0" ?>
<server class="org.jpos.q2.iso.QServer" logger="Q2"  name="SSLServer">
<attr name="port" type="java.lang.Integer">1980</attr>
<attr name="socketFactory">org.jpos.iso.SunJSSESocketFactory</attr>
<attr name="maxSessions" type="java.lang.Integer">3000</attr>
<channel class="org.jpos.iso.channel.NCCChannel"  logger="Q2" header="6000000000" packager="org.unipay.iso.packager.ISO87BINNOPackager">
</channel>
<request-listener class="org.unipay.iso.listener.UnipayQEMIRequestListener" logger="Q2"/>
</server>

We have maxSessions as 3000 do you mean this the Threadpool size.
If this the Thread pool size already in our application we are using it and we are facing the below error.
<thread-pool name="ThreadPool-2-3">
  <jobs>100</jobs>
  <size>100</size>
  <max>100</max>
  <active>100</active>
  <idle>0</idle>
  <active>100</active>
  <pending>0</pending>
</thread-pool>


Request you to please assist and need your guidance here.

murtuza chhil

unread,
Mar 8, 2022, 3:46:28 AM3/8/22
to jPOS Users
Figure out where threadpool by the name "ThreadPool-2-3" is created and determine if the size is right and your handling is incorrect, or the size needs to be upped.

 3000 persistent connections for the server sample you have provided appear to be high.

-chhil

Reply all
Reply to author
Forward
0 new messages