Identifying the cause of a slow message flow

You can use the message flow statistics data to help you identify aspects of a message flow that might be reducing the performance of the flow, and to help you understand how you can optimize it.

Before you begin

About this task

Follow these steps to identify the factors that might be limiting the speed of a message flow, and to find out how you can increase the overall performance:

Procedure

  1. Use the web user interface to display the statistics for your message flow.
    You can use the information in the Flow analysis view to assess the performance of your message flows. This view contains detailed statistical information about the selected message flow, including statistics such as the message rate, CPU time, and elapsed time for each node in the message flow. You can use these statistics to help you identify the nodes in your message flow that are the most expensive in terms of performance.

    Use the charts in the Flow analysis view to show data for any three statistics at a time; by default, the charts show the message rate, average elapsed time, and average CPU time for the nodes in the selected message flow:

    • Use the Message rate chart to check the period of time during which the message rate has been low.
    • Use the Average elapsed time chart with the Message rate chart to check whether there is a correlation between the two statistics for this flow. If there is an increase in Average elapsed time and a reduction in Message rate, check the Total input messages to see whether messages have been entering the message flow. An increase in Average elapsed time might indicate that there is a bottleneck in message processing that might be caused by waiting for an external resource, such as a database. Check the data in the Latest data per node table to identify nodes with high elapsed times.
    • Use the Average CPU time chart to see whether the CPU time has increased or decreased in correlation with the Message rate. If the CPU time increases and the message rate decreases, it might indicate that there is a problem with the throughput of the message flow. If the Average elapsed time is high and the Average CPU time is low, it is likely that the message flow is waiting for something other than CPU; this is typically a slow node or invocation of an application or service. If the Average elapsed time and Average CPU time are both high, the message flow is likely to be CPU bound; in this case, verify that all known design, tuning, and coding optimizations have been applied. For example, check the size of the messages that are being processed to see if it has increased in line with the drop in rate. If the CPU has recently increased, check the commit counts, errors, and backouts. For more information about designing for performance, see Message flow design and performance and Code design and performance.

    For more information about viewing statistics data, see Viewing message flow statistics and accounting data.

  2. When you have identified the nodes that are the most expensive in terms of performance, identify the type of node; some of the techniques that you can use to optimize the performance vary according to the node type:
    • If the most expensive node is a Compute node, there might be issues with your ESQL code. For information about how to optimize ESQL, see ESQL code tips.
    • If the most expensive node is a JavaCompute node, see Java code tips for information about how you might optimize performance for the node.
    • If the most expensive node uses XPath, see XPath and XSLT code tips to find out how you might optimize performance for the node.
    • If the most expensive node is a request node, it might be waiting for input from an external resource. You can use the activity log to see where resources such as databases are taking a long time to respond or process data; for more information, see Using Activity Logs.
  3. Consider the overall design of your message flow; the following design decisions can have a significant impact on message flow throughput and response times:
    • The number of threads processing messages in a single message flow
    • The number of copies of a message flow
    • The scope of the message flow
    • The frequency of commits
    • The number of nodes in the message flow
    • The way in which the message flow routes and processes messages
    • The use of loops
    • The use of persistent and transactional messages
    • Message size
    • Message format

    For more information about these design decisions, see Message flow design and performance.

  4. Parsing can have a significant impact on message flow performance, and there are techniques that you can use to limit the effect. For more information, see Parsing and message flow performance.
  5. Message tree navigation and message tree copying can reduce message flow performance, so it is important to use them appropriately and limit their use where possible. For more information, see Message tree navigation and copying.

What to do next

For more information about improving performance the performance of your message flows, see Tuning message flow performance. For information about solving specific performance issues, see Troubleshooting performance problems.