Troubleshooting: Socket timeout with heavy Search use
You may experience timeout issues when the Search server is under a heavy working load. This situation can arise when Search server resources are dedicated to internal activities, such as calculating image or product display sequences. To alleviate this problem, increase the WebSphere Commerce server timeout value.
Problem
You may experience socket timeout behavior when the Search server is busy and does not respond
promptly to requests from the WebSphere Commerce Server. In such cases a Solr diagnostic will
read timeouts when calling the Search REST service. The example below shows timeouts when polling
the product display sequencing
function.
SystemOut_16.09.14_17.59.59.log:[9/14/16 17:59:59:497 EDT] 000000e8 ProductDispla E com.ibm.commerce.search.internal.commands.ProductDisplayPropertiesDeleteCmdImpl
callSearchHandlerToDeleteFile(JSONObject, String) calling Search REST failed with error: java.lang.RuntimeException: java.net.SocketTimeoutException:
Read timed out
SystemOut.log:[9/14/16 18:00:02:309 EDT] 000000f6 ProductDispla E com.ibm.commerce.search.internal.commands.ProductDisplayPropertiesDeleteCmdImpl
callSearchHandlerToDeleteFile(JSONObject, String) calling Search REST failed with error: java.lang.RuntimeException: java.net.SocketTimeoutException:
Read timed out
SystemOut.log:[9/14/16 18:00:08:238 EDT] 0000010d ProductDispla E com.ibm.commerce.search.internal.commands.ProductDisplayPropertiesUpdateCmdImpl
callSearchHanlderToGenerateFile(JSONObject, String) calling Search REST failed with error: java.lang.RuntimeException: java.net.SocketTimeoutException:
Read timed out
SystemOut.log:[9/14/16 18:00:08:239 EDT] 0000010d CommerceSrvr E com.ibm.commerce.search.internal.commands.ProductDisplayPropertiesUpdateCmdImpl
callSearchHanlderToGenerateFile(JSONObject, String) CMN0301E: Communication error {0}: "{1}". java.lang.RuntimeException: java.net.SocketTimeoutException:
Read timed out
Solution
Increase the WebSphere Commerce Server timeout value.
Procedure
- Edit or create the file /opt/WebSphere/AppServer/profiles/demo/installedApps/WC_demo_cell/WC_demo.ear/xml/config/com.ibm.commerce.foundation-ext/wc-component.xml. If you have to create a new wc-conponent.xml file, add the file's minimum default content. This XML content is described in Changing properties in the component configuration file (wc-component.xml) (WC EAR).
- Change the value attribute of the
CommerceServerSetting/RemoteRestRequestConnectTimeout
andCommerceServerSetting/RemoteRestRequestReadTimeout
properties to a large number (for instance, 30 minutes). If the property does not exist, add it under an existingconfiggrouping
element that has the name CommerceServerSetting, or add a newconfiggrouping
element to contain the property.<_config:configgrouping name="CommerceServerSetting"> <_config:property name="CommerceServerSetting/RemoteRestRequestConnectTimeout" value="1800000"/> <_config:property name="CommerceServerSetting/RemoteRestRequestReadTimeout" value="1800000"/> </_config:configgrouping>
- Restart the WebSphere Commerce Server.
With a sufficiently high number, the socket will not time out.