我去了以下网站:
http://www.mulesoft.org/documentation/display/current/Tuning+Performance
它说要改变以下两个值:
maxThreadsActive and maxBufferSize
maxThreadsActive是任何时候活动线程的数量,maxBufferSize是可以在队列中等待的请求数
但我很难在代码中找到如何执行此操作的任何示例。
- 是否有一个中央Mule ESB文件,我可以更改默认的maxThreadsActive和maxBufferSize数量?
如果没有中央文件,对于同步过程,我如何更改以下代码以使用最大活动线程数为100,并将队列上的最大请求数更改为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>
由于
答案 0 :(得分:3)
您可以在流程中使用排队异步处理策略。使用此方法,您可以更改流可用的线程数。
例如:
<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>
&#34;您可以为每个接收者线程池,流线程池和调度程序线程池指定单独的线程配置文件&#34;。例如:
<http:connector name="DefaultHTTPConnector" clientSoTimeout="120000" keepSendSocketOpen="false" >
<receiver-threading-profile maxThreadsActive="500"/>
<dispatcher-threading-profile maxThreadsActive="500"/>
</http:connector>
或
<configuration>
<default-receiver-threading-profile maxThreadsActive="130" />
</configuration>
我推荐流程中的第一个选项。 我希望能提供帮助;
答案 1 :(得分:2)
您无法在请求 - 响应交换模式上添加流处理策略
答案 2 :(得分:-1)
添加全局配置元素,如下所示: