Disk access has the most influence on the SwiftMQ performance. Normally, the default settings of the Store Swiftlet are sufficient and are optimized for the average standard operation. Concerning advanced applications, various tuning possibilities are discussed within this chapter.
The initial size of the file "page.db" may be configured via the attribute "initial-page-size". The default setting is 512 pages (1024 KB). It is not guaranteed, but most of the operating systems create a continuous space if the file size is given and if procurable. Such a coherent disk partition reduces the number of positionings during a disk access. If your "page.db" is permanently greater (thus you store simultaneously many messages), you should increment the "initial-page-size" to allocate a maximum coherent area. Please notice, this attribute only has an effect if the file does not exist. Therefore you should first delete "page.db" and than start the router with the modified "initial-page-size". Further, please take notice that all pages are read during the router startup to locate free pages. Thus, a larger size implicates a longer startup time.
The cache may be configured by the two attributes "min-size" and "max-size". Both values are numbers of pages. The cache manager makes sure that the cache size retains during that interval. When reaching the "max-size", an automatic flushing of all dirty pages takes place unless these are in use (pin). The flush is continued as long as the "min-size" is reached resp. no dirty unpinned pages exist. The default settings are 1024 pages concerning the "min-size" and 2048 pages concerning the "max-size". This is optimal for a write/read-transaction mix, i. e. messages are stored but they are reread in best time. In that case no disk access takes place with the exception of the transaction log. All transactions are served out of the cache as deallocated pages also remain within the cache. If you have many write-transactions and an extended message dwell, you should increase respectively the "max-size" to avoid the automatical flush.
The attribute "checkpoint-size" specifies the size of the transaction log ("transaction.log"). After reaching, a checkpoint is performed. This means a pause of all transactions, a complete flush of the Cache, sync of the disk, and the enabling of all transactions. The "checkpoint-size" default setting is 50 MB. This proves optimal. A checkpoint then requires around 30 milliseconds. A minor size implicates more checkpoints and, as a result, more disk syncs. A larger size accordingly requires a bigger cache so that the duration of a checkpoint increases as more is written. Please consider that all transactions are stopped during a checkpoint.
A disk sync of the transaction log may be forced over the attribute "force-sync". The default setting is "false". In the case of "true" a disk sync is executed with every interval of the log manager. During one intervall, the log manager may write several log records into the transaction log (group commit) as it works asynchron. However, this is only the case when having a high parallelism of transactions. It doesn't increase the throughput of single transactions but only the overall throughput (scalability).
The default mode of "false" is less reliable and you may loose data if the computer crashes. However, the throughput is many times higher than with disk sync. Forcing disk syncs is reliable, but the performance is then bound to the speed of the disk, which varies.
Which mode you use is up to you and usually a matter of costs.
The interval in which the log manager syncs with the disk can be delayed. This is done via the attribute "group-commit-delay" which contains a millisecond value. If this value is greater than 0, the log manager waits this amount of time before it continues. Here the chance is bigger to have multiple log records within the next interval and the throughput will be higher. However, this is only the case with a high parallelism of transactions. The default delay is 0 (no delay). It is only applied if disk sync is enabled.