LogDefaults stanza of the mqs.ini file
Use the Default log settings IBM MQ properties page from the IBM MQ Explorer, or the LogDefaults stanza in the mqs.ini file to specify information about log defaults for all queue managers.
If the stanza does not exist then the MQ defaults will be used. The log attributes are used as default values when we create a queue manager (crtmqm), but can be overridden if we specify the log attributes on the crtmqm command.
Once a queue manager has been created, the log attributes for that queue manager are taken from the settings described in Log stanza of the qm.ini file.
The default prefix (specified in AllQueueManagers stanza of the mqs.ini file ) and log path specified for the particular queue manager (specified in Log stanza of the qm.ini file ) allow the queue manager and its log to be on different physical drives. This is the recommended method, although by default they are on the same drive.
For information about calculating log sizes, see Calculating the size of the log.
Note: The limits given in the following parameter list are limits set by IBM MQ. Operating system limits might reduce the maximum possible log size.
- LogPrimaryFiles= 3|2-254 (Windows)|2-510 (UNIX and Linux )
- The log files allocated when the queue manager is created.
The minimum number of primary log files we can have is 2 and the maximum is 254 on Windows, or 510 on UNIX and Linux. The default is 3.
The total number of primary and secondary log files must not exceed 255 on Windows, or 511 on UNIX and Linux, and must not be less than 3.
The value is examined when the queue manager is created or started. We can change it after the queue manager has been created. However, a change in the value is not effective until the queue manager is restarted, and the effect might not be immediate.
- LogSecondaryFiles= 2|1-253 (Windows)|1-509 (UNIX and Linux)
- The log files allocated when the primary files are exhausted.
The minimum number of secondary log files is 1 and the maximum is 253 on Windows, or 509 on UNIX and Linux. The default number is 2.
The total number of primary and secondary log files must not exceed 255 on Windows, or 511 on UNIX and Linux, and must not be less than 3.
The value is examined when the queue manager is started. We can change this value, but changes do not become effective until the queue manager is restarted, and even then the effect might not be immediate.
- LogFilePages= number
- The log data is held in a series of files called log files. The log file size is specified in
units of 4 KB pages.
The default number of log file pages is 4096, giving a log file size of 16 MB.
On UNIX and Linux, the minimum number of log file pages is 64, and on Windows, the minimum number of log file pages is 32; in both cases the maximum number is 65 535.
Note: The size of the log files specified during queue manager creation cannot be changed for a queue manager. - LogType= CIRCULAR|LINEAR
- The type of log to be used. The default is CIRCULAR.
- CIRCULAR
- Start restart recovery using the log to roll back transactions that were in progress when the
system stopped.
See Types of logging for a fuller explanation of circular logging.
- LINEAR
- For both restart recovery and media or forward recovery (creating lost or damaged data by
replaying the contents of the log).
See Types of logging for a fuller explanation of linear logging.
To change the default, we can either edit the LogType attribute, or specify linear logging using the crtmqm command.
From IBM MQ Version 9.1.0, you can change the logging method after a queue manager has been created. See migmqlog for more information.
- LogBufferPages= 0|0-4096
- The amount of memory allocated to buffer records for writing, specifying the size of the buffers
in units of 4 KB pages.
The minimum number of buffer pages is 18 and the maximum is 4096. Larger buffers lead to higher throughput, especially for larger messages.
If you specify 0 (the default), the queue manager selects the size. In IBM WebSphere MQ Version 7.1 this is 512 (2048 KB).
If you specify a number in the range 1 through 17, the queue manager defaults to 18 (72 KB). If you specify a number in the range 18 and through 4096, the queue manager uses the number specified to set the memory allocated.
- LogDefaultPath= directory_name
- The directory in which the log files for a queue manager reside. The directory resides on a
local device to which the queue manager can write and, preferably, on a different drive from the
message queues. Specifying a different drive gives added protection in case of system failure.
The default is:
- DefaultPrefix\log for IBM MQ for Windows where DefaultPrefix is the value specified on the DefaultPrefix attribute on the All Queue Managers IBM MQ properties page. This value is set at installation time.
- /var/mqm/log for IBM MQ for UNIX and Linux systems
Alternatively, we can specify the name of a directory on the crtmqm command using the -ld flag. When a queue manager is created, a directory is also created under the queue manager directory, and this is used to hold the log files. The name of this directory is based on the queue manager name. This ensures that the log file path is unique, and also that it conforms to any limitations on directory name lengths.
If we do not specify -ld on the crtmqm command, the value of the LogDefaultPath attribute in the mqs.ini file is used.
The queue manager name is appended to the directory name to ensure that multiple queue managers use different log directories.
When the queue manager is created, a LogPath value is created in the log attributes in the configuration information, giving the complete directory name for the queue manager's log. This value is used to locate the log when the queue manager is started or deleted.
- LogWriteIntegrity=SingleWrite|DoubleWrite|TripleWrite
- The method the logger uses to reliably write log records.
- TripleWrite
- This is the default method.
Note, that we can select DoubleWrite, but if you do so, the system interprets this as TripleWrite.
- SingleWrite
- We should use SingleWrite, only if the file-system and device hosting the IBM MQ recovery log explicitly guarantees the atomicity of 4KB writes.
That is, when a write of a 4KB page fails for any reason, the only two possible states are either the before image, or the after image. No intermediate state should be possible.
Note: If there is sufficient concurrency in your persistent workload, there is minimal potential benefit in setting anything other than the default value, TripleWrite.
See LogWriteIntegrity - using SingleWrite or TripleWrite for more information.
Parent topic: Attributes for changing IBM MQ configuration information