Firstly, it is pertinent to validate and mitigate below at NW/FW as required,
a) Check if any TCP handshake packet loss in happening or TCP SPURIOUS TRANSMISSION if happening from third party afterwards.
b) Check if application is trying to DUP ack and any unsuccessful attempts are there.
c) Validate if there are any intermittent packet loss.
d) Check route and devices.
e) Check /etc/hosts for application layers
Take below steps iteratively for performance enhancements,
1. Loggers to be reduced(DEBUG/INFO) to prevent high thread usage in flows.
2. Reduce timeout values which for example 30seconds to be reduced to 15 seconds or less iteratively, to avoid stucking of threads in long running state.
3. Addition of global level configuration for thread profiling : (applies to the overall application and handles the threading strategy at the runtime )
<default-threading-profile maxThreadsActive=”500″ maxThreadsIdle=”20″ threadTTL=”30000″ maxQueueSize=”500″ poolExhaustedAction=”WAIT”/>
4. To add connection pooling ad configurations to http requests : Iterative testing in test environments as the compatibility of tags should be tested.Example :
<http:request-config name=”reXXXXX_api” host=”X.X.X.X” port=”XXXX” protocol=”HTTP”> <http:request-connection-pooling> <http:pooling-profile maxActive=”50″ maxIdle=”20″ maxWait=”30000″/> </http:request-connection-pooling> <http:connection-idle-timeout unit=”SECONDS” value=”60″/> </http:request-config>
Use the same in the flow ref :
<http:request config-ref=”recharge_api” path=”/recharge” method=”POST” doc:name=”Rexxxxxx API Request”> <http:request-builder> <http:header headerName=”Content-Type” value=”application/json”/> <http:header headerName=”Authorization” value=”Bearer #[vars.authToken]”/> </http:request-builder> <http:response-timeout>15000</http:response-timeout> </http:request>
5. To Identify HTTP requests that can be processed asynchronously and encapsulate them within <async> blocks to prevent blocking:
<async> <http:request config-ref=”rexxxxxx_api” path=”/Axx” method=”POST” responseTimeout=”10000″/> </async>
6. Apply queued-asynchronous-processing-strategy for better concurrency management and on synchronous use synchronous processing strategies
<flow name=”asyncRechargeFlow” processing-strategy=”queued-asynchronous-processing-strategy”>
<flow name=”syncProcessingFlow” processingStrategy=”synchronous”>
7. Adjust heap sizes based on workload with muleStartup.sh Set initial and max heap size.
JAVA_OPTS=”-Xms2g -Xmx4g -XX:NewRatio=2 -XX:SurvivorRatio=8 -XX:+UseG1GC -XX:MaxGCPauseMillis=200″; export JAVA_OPTS;