1
votes

I went to the following site:

http://www.mulesoft.org/documentation/display/current/Tuning+Performance

and it says to alter the following 2 values:

maxThreadsActive and maxBufferSize

with maxThreadsActive being the number of active threads at anyone time, and maxBufferSize being the number of requests that can wait in a queue

But I am having difficulty finding any examples of how to do this in code.

-- Is there a central Mule ESB file where I can change the default number of maxThreadsActive and maxBufferSize ???

Would this be the dispatcher threading profile. What file would that be ?

--

If there is no central filet, for a synchronous process, how would I change the following code to use a maximum number of active threads to 100 and a maximum number of requests on the queue to 60

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd">
    <db:generic-config name="Generic_Database_Configuration" url="jdbc:db2://localhost:50000/TEST:user=instuid;password=instpw;" driverClassName="com.ibm.db2.jcc.DB2Driver" doc:name="Generic Database Configuration"/>
    <http:endpoint exchange-pattern="request-response" host="localhost" port="8081" method="POST" name="HTTP" doc:name="HTTP"/>
    <flow name="test1Flow1" doc:name="test1Flow1">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" contentType="application/json" keepAlive="true"  mimeType="application/json"/>
        <echo-component doc:name="Echo"/>
    </flow>
</mule>

Thanks

3

3 Answers

3
votes

You can used a queued-asynchronous processing strategy in you flow. With this approach you can change the number of threads available to the flow.

For Example:

<queued-thread-per-processor-processing-strategy name="ProcessingStrategy" maxThreads="60" minThreads="10" threadTTL="5000" poolExhaustedAction="WAIT" threadWaitTimeout="5000" maxBufferSize="100"/>

<flow name="test1Flow1" doc:name="test1Flow1" processingStrategy="ProcessingStrategy">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" contentType="application/json" keepAlive="true"  mimeType="application/json"/>
    <echo-component doc:name="Echo"/>
</flow>

"You can specify a separate threading profile for each receiver thread pool, flow thread pool, and dispatcher thread pool". For example:

<http:connector name="DefaultHTTPConnector" clientSoTimeout="120000"  keepSendSocketOpen="false" >
    <receiver-threading-profile maxThreadsActive="500"/>
    <dispatcher-threading-profile maxThreadsActive="500"/>
</http:connector>

or

<configuration>
    <default-receiver-threading-profile maxThreadsActive="130" />
</configuration>

I recommend the first option in the flow. I hope to help;

2
votes

You cannot add a flow processing strategy on a request-response exchange pattern

-1
votes

Add a global configuration element as follows: