Web services performance best practices
Learn about best practices for the performance of web services applications.
Web services are developed and deployed based on standards provided by the Web Services for Java EE specification and the JAX-WS and Java Architecture for XML Binding (JAXB) programming models, and is the mechanism used to access a web service. Performance considerations for web services supported by this specification are explained.
When we develop or deploy a web service, several artifacts are required, including a Web Services Description Language (WSDL) file. The WSDL file describes the format and syntax of the web service input and output SOAP messages. When a web service is implemented in the WebSphere Application Server runtime, the SOAP message is translated based on the Java EE request. The Java EE-based response is then translated back to a SOAP message.
The most critical performance consideration is the translation between the XML-based SOAP message and the Java object. Performance is high for a web service implementation in WAS, however, application design, deployment and tuning can be improved. See the information on monitoring the performance of Web services applications to learn more about analyzing and tuning Web services.
If we are using a web service application that was developed for a WAS version prior to v6, we can achieve better performance by running the wsdeploy command. The wsdeploy command regenerates web services artifact classes to increase the serialization and deserialization performance.
The wsdeploy command is supported by JAX-RPC applications. The JAX-WS programming model implemented by the application server does not support the wsdeploy command. If our web services application contains only JAX-WS endpoints, we do not need to run the wsdeploy command, as this command is used to process only JAX-RPC endpoints.
Basic considerations for a high-performance web services application
The following are basic considerations we should know when designing a web services application:
- Reduce the web services requests using a few highly functional APIs, rather than several simple APIs.
- Design your WSDL file interface to limit the size and complexity of SOAP messages.
- Use the document/literal style argument when we generate the WSDL file.
- Leverage the caching capabilities offered for WAS.
- Test the performance of our web service.
Optimize JAX-WS web services performance for WAS
Depending on the web services usage scenario, we can use the following JVM custom properties to optimize JAX-WS web services performance. After we change the values of these JVM custom properties, WAS must be restarted for the changes to take effect.
- In WAS 8.5.5.2 or later, use the following custom property for JAXB performance optimization:
- com.ibm.websphere.webservices.jaxwsOptimizeLevelOne
- Configure this custom property to true to turn on JAX-WS performance optimization at level one.
- The default is false.
When this custom property is enabled, some non-specification JAXB behavior might be changed. Disable the property if the application has a dependency on such non-specification behavior and you find that it causes the application to run unsuccessfully.
We might find that the order of XML tags in a SOAP message is different from previous versions.
- In WAS 8.5.5.0 or later, use the following custom properties for JAX-WS engine global handlers performance optimization. Be careful when we enable the following custom properties. Otherwise, the corresponding web services function will not work. In addition, the following JVM properties will not impact the user-defined JAX-WS handlers.
- com.ibm.ws.websvcs.disableWSDMHandler
- Control whether to disable web services JAX-WS engine handlers for the WSDM (Web Services Distributed Management) function. The default is false.
- com.ibm.ws.websvcs.disableWSSecurityHandler
- Control whether to disable web services JAX-WS engine handlers for the WS-Security function. The default is false.
- com.ibm.ws.websvcs.disableWSTXHandler
- Control whether to disable web services JAX-WS engine handlers for the WS-Transaction function. The default is false.
- com.ibm.ws.websvcs.disableWSRMHandler
- Control whether to disable web services JAX-WS engine handlers for the WS-RM function. The default is false.
- com.ibm.ws.websvcs.disablePMIHandler
- Control whether to disable web services JAX-WS engine handlers for the web service PMI data collection function. The default is false.
- com.ibm.ws.websvcs.disablePMIRMHandler
- Control whether to disable web services JAX-WS engine handlers for the web service PMI data collection for the WS-RM function. The default is false.
- com.ibm.ws.websvcs.disableAddressingHandler
- Control whether to disable web services JAX-WS engine handlers for the WS-Addressing function. The default is false.
- com.ibm.ws.websvcs.disableDefaultGlobalHandlers
- Control whether to disable all default web services JAX-WS engine handlers. If this property was configured to true, then it overrides the value of the following custom properties and sets their values to true.
- com.ibm.ws.websvcs.disableWSDMHandler
- com.ibm.ws.websvcs.disableWSSecurityHandler
- com.ibm.ws.websvcs.disableWSTXHandler
- com.ibm.ws.websvcs.disableWSRMHandler
- com.ibm.ws.websvcs.disablePMIHandler
- com.ibm.ws.websvcs.disablePMIRMHandler
- com.ibm.ws.websvcs.disableAddressingHandler
- The default value of this custom property is false.
Additional web services performance features that we can leverage
- In-process optimizations for web services to optimize the communication path between a web services client application and a web container located in the same application server process. For details about enabling this feature, see the web services client to web container optimized communication information.
- Access to web services over multiple transport protocols extends existing Java API for XML-based remote procedure call (JAX-RPC) capabilities to support non-SOAP bindings such as RMI/IIOP and JMS. These alternative transports can improve performance and quality of service aspects for web services. For more detailed information see the RMI-IIOP using JAX-RPC information.
- SOAP with Attachments API for Java (SAAJ) Version 1.2 provides a programming model for web services relative to JAX-RPC. The SAAJ API provides features to create and process SOAP requests using an XML API. SAAJ supports just-in-time parsing and other internal algorithms. For information about SAAJ or web services programming, see the SOAP with Attachments API for Java information.
SAAJ 1.3 provides support for web services developed and implemented based on the JAX-WS programming model.
- The web services tooling generates higher performance custom deserializers for all JAX-RPC beans. Redeploying a V5.x application into the V6 runtime can decrease the processing time for large messages.
- Serialization and deserialization runtime is enhanced to cache frequently used serializers and deserializers. This can decrease the processing time for large messages.
IBM provides considerable documentation and best practices for web services application design and development that details these items and more.
Related:
SOAP with Attachments API for Java interface RMI-IIOP using JAX-RPC Monitor the performance of web services applications Web services client to web container optimized communication Web services specifications and APIs