78 lines
5.2 KiB
HTML
78 lines
5.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
|
|
|
<title>Web services tuning tips</title>
|
|
</head>
|
|
|
|
<BODY>
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
<h4><a name="prftunews"></a>Web services tuning tips</h4>
|
|
|
|
<p>Web services performance is affected primarily by these characteristics of the XML documents that are sent to Web services:</p>
|
|
<ul>
|
|
<li><strong>Size</strong> refers to the length of data elements in the XML document.</li>
|
|
<li><strong>Complexity</strong> refers to number of elements that the XML document contains.</li>
|
|
<li><strong>Level of nesting</strong> refers to objects or collections of objects that are defined within other objects in the XML document, as in this example:
|
|
<pre>
|
|
<primaryObject>
|
|
<groupObject>
|
|
<singleObject/>
|
|
<singleObject/>
|
|
</groupObject>
|
|
</primaryObject>
|
|
</pre></li>
|
|
</ul>
|
|
|
|
<p>In addition, a Web services engine contains three major pressure points that define the performance of Web services:</p>
|
|
|
|
<ul>
|
|
<li><strong>Parsing</strong> (Input): When a request is received, the Web services engine parses the input. There are two major performance components in parsing:
|
|
<ul>
|
|
<li>scanner</li>
|
|
<li>symbol or name identification</li>
|
|
</ul></li>
|
|
<li><strong>XML-to-object deserialization</strong> (Input): As the document is parsed the XML input is deserialized and converted into business objects that are presented as business object parameters to the Web services. The Web services provider, which is a JavaBean provider, is not aware of its participation in a Web service.</li>
|
|
<li><strong>Object-to-XML serialization</strong> (Output): After the request is processed, reply is serialized into an XML document. Large documents or complex objects can affect output serialization.</li>
|
|
</ul>
|
|
|
|
<p><strong>Web services best practices</strong></p>
|
|
|
|
<p>To optimize Web services performance, follow these general guidelines:</p>
|
|
|
|
<ul>
|
|
<li><p><strong>Use WebSphere Application Server - Express Web services instead of SOAP</strong>
|
|
<br>The WebSphere Application Server - Express Web services implementation performs better than the SOAP implementation based on Apache SOAP. WebSphere Application Server - Express includes support for the Apache SOAP implementation so that you can run existing Web services applications.</p></li>
|
|
|
|
<li><p><strong>Avoid large or complex XML documents</strong>
|
|
<br>The performance of Web services is directly related to the size and complexity of the XML document that is transferred. As input documents increase in size or number of elements, they require more processing for parsing and deserialization. As output documents increase in size or number of elements, they require more processing for serialization.</p></li>
|
|
|
|
<li><p><strong>Avoid small, frequent requests</strong>
|
|
<br>By definition, every Web services request is a remote request. These requests usually involve the Web container in addition to the XML overhead of parsing and deserialization. If you need to send or retrieve a 50K object that has 10 properties that are each 5K long, you can retrieve the object in several ways, such as:</p>
|
|
<ul>
|
|
<li>As one 50K request</li>
|
|
<li>As 10 5K requests</li>
|
|
<li>As 50 1K requests</li>
|
|
</ul>
|
|
<p>Because of the overhead associated with the Web container, it is more efficient to transfer a single 50K request than several smaller requests.</p></li>
|
|
|
|
<li><p><strong>Limit the level of nesting in XML documents</strong>
|
|
<br>Increasing the level of object nesting results in an increase in the number of objects that are deserialized and created when a request is processed. An object that is composed only of primitive types or strings is processed more efficiently than an object of a similar size that is composed of deeply nested Java objects.</p></li>
|
|
|
|
<li><p><strong>Use WebSphere Application Server - Express custom serializers</strong>
|
|
<br>The WebSphere Application Server - Express Web services engine provides serialization and deserialization helpers that improve runtime performance for business objects. These custom serializer and deserializer helpers specifically describe an object's properties. As a result, the Web services runtime consumes fewer resources to obtain information about the object.</p></li>
|
|
|
|
<li><p><strong>When possible, use literal encoding instead of SOAP encoding</strong>
|
|
<br>Literal and SOAP encoding are alternate forms for encoding Web services requests and responses. Each element in the SOAP body includes the XML schema definition type of the data element. SOAP encoding requires this information to make the XML document self-defining. SOAP encoding with the embedded data types increases the amount of data transferred in the Web services request.</p></li>
|
|
|
|
<li><p><strong>Use descriptive but short property names</strong>
|
|
<br>Web services is an XML text-based exchange protocol, and the names of variables and properties are included in the XML for the SOAP body portion of the message. Longer property names increase the size of the XML document.</p></li>
|
|
</ul>
|
|
|
|
</body>
|
|
</html>
|