SQL/MX Queuing and Publish/Subscribe Services
Major Queuing Features
HP NonStop SQL/MX Queuing and Publish/Subscribe Services—523734-002
2-16
Run-Time Limits on Streams
Run-Time Limits on Streams
When a row is published into a table that has a cursor opened for stream access, the
HP NonStop Data Access Manager (DAM) puts an entry into a list used by the
streaming cursor if the cursor's position in the table is logically after the position of the
newly published row. The streaming cursor uses this list when it finishes its regular
scan of the table so that it can find the new row, and then the entry is removed from the
list.
The list has a fixed size. Currently, the list accommodates 4096 rows per volume,
shared by all cursors. Each cursor is further limited to using 800 rows in a list. If rows
are published into the table faster than the streaming cursor can service the list, the list
will overflow. In this case, the next time the streaming cursor tries to use the list,
SQL/MX will display error 8553: “Stream overflow; subscription rate has fallen too far
behind publishing rate,” and the cursor will be closed.
Application designers must plan to avoid or recover from this stream overflow
condition. Applications that must handle a fast rate of publishing into the stream, or that
publish rows in very large transactions, are particularly vulnerable. To minimize the risk
of overflow, design applications that can use several streams to select or dequeue new
rows. Applications can also restart dequeueing streams after an overflow.
This list is used only for inserted or updated rows that are logically positioned behind
the subscriber’s current position. If the subscriber accesses a table clustered by a
syskey (or some ever-increasing column, such as a timestamp) and the publisher
always inserts new rows instead of updating existing rows, then the list is not needed
by the publisher, and the risk of overflow is low.
If the application must use a publisher that updates existing rows, then a timestamp
column with an index can be used as the access path of the subscriber. To ensure that
all rows are published ahead of the subscriber’s current position, the publisher can
update the timestamp to the current time whenever an existing row is updated. Taking
these steps eliminates overflows caused by publishers. However, because the list is
also used by subscribers to implement SKIP CONFLICT access, there is still some
possibility of overflow.
The DAM also limits the total number of cursors using stream access mode to 512 per
volume. If this limit is exceeded, cursors can receive error 8553 when they try to use
the list.