Java CAPS JMS Reference

Segment Size

The JMS IQ Manager database consists of multiple memory-mapped database files known as segments. The Segment Size property specifies the total number of pages in each segment file. A page is 512 bytes on Windows and 1024 bytes on UNIX. The default segment size is 16,384 pages, which is 8 MBytes for Windows and 16 MBytes for UNIX. By default, these segments are named stcms*.dbs and reside in the message server folder on the Logical Host.

You should set the segment size to a value larger than the sum of the following items:


Note –

The transaction size is the sum of the sizes of all messages in one transaction. If transactions span no more than one message, the maximum transaction size is equal to the size of the largest message.


For example, consider a UNIX system, where you expect no more than 100 subscribers and that messages will not exceed 100 KBytes, and that only one message will be sent/received per transaction. Since the page size on UNIX is 1 KByte, you would set the segment size to at least [100 + (100KBytes/1KByte) + 10] = 210 pages.

With this setting, only one 100,000 byte message may exist in each segment. The ideal segment size depends on the circumstances. If the slowest subscriber lags behind the fastest publisher by a certain number of messages, you can set the segment size so that this number of messages will fit a single segment.

The JMS IQ Manager cleans up the database by recycling segments for which all messages have either expired or have been retrieved by their subscribers.

A lower segment size setting results in more efficient use of the disk because smaller segments turn over more rapidly and thus provide more effective use of server memory. However, a lower segment size means that the server might need to allocate more new segments, which requires more time than freeing a cleaned-up segment. In addition, if a transaction is larger than the specified segment size, the server rolls back the transaction. You must then increase the Segment Size property to an amount larger than the message.

A high segment size setting can be advantageous in that cleanup runs less often, although each cleanup takes somewhat longer. However, cleaning up two small segments still requires more time than cleaning up one large segment. Therefore, a large segment size can increase performance on systems that are constrained by disk I/O speed rather than memory or storage space.

Allowed Values

An integer greater than 1. Set this property to at least twice the total number of anticipated durable subscribers.

Default Value

The default segment size is 16,384 pages, which is 8 MBytes for Windows and 16 MBytes for UNIX.


Note –

Modifying the Segment Size requires changes to the database files. You must manually delete the existing database files and restart the domain server before the changes actually occur. To prevent message loss, make sure that no unread messages remain before deleting the database files.