h1. Best Practices for Messaging Server and ZFS
{panel:borderStyle=none|titleBGColor=#BDBEC0|bgColor=#f5f5f5}
*Update 10/14/09*
This information needs to be updated to include the pros and cons of using ZFS.
{panel}
[ZFS|http://www.sun.com/software/solaris/zfs.jsp] provides the following features that make it ideal for backing up the Messaging Server message store:
* Snapshot backup
* Enables the use of less expensive SATA drives
* Built-in volume manager that enables you to grow file systems dynamically
Topics:
{toc:minLevel=2|maxLevel=2}
h2. Configuration Recommendations for ZFS and Messaging Server
# Separate the Messaging Server mboxlist database, message file, and index cache files on different file systems.
\\
The mboxlist database is a sleepycat database that contains mailbox meta data.
\\
The index cache records ({{store.idx}} and {{store.c*}}) contain meta information about mailboxes and messages. Messaging Server accesses and modifies this meta information, although the modifications tend to be more random and smaller. The location of the index cache records is controlled by the {{configutil}} parameter {{store.partition.}}_partition\_name_{{.path}}, where _partition\_name_ is the name of the partition.
\\
Each message file ({{*.msg}}) represents a single email. Each message file is written to disk once, never modified, read many times (for example, when a user accesses the email, when the messages are backed up, and so on) and may be deleted. By default, these files are stored with the index and cache files. Message files location is controlled by the {{configutil}} parameter {{store.partition.}}_partition\_name_{{.messagepath}}, where _partition\_name_ is the name of the partition.
\\
Separating the message files from the index cache records to different partitions (and underlying file systems) enables you to configure the file system with properties appropriate for the access type.
\\
Examples:
{{# zfs create store/mboxlist}}
{{# zfs set mountpoint=/var/opt/sun/comms/messaging/store/mboxlist store/mboxlist}}
\\
{{# zfs create store/primary-idx}}
{{# configutil -o store.partition.primary.path -v /store/primary-idx}}
\\
{{# zfs create store/primary-msg}}
{{# configutil -o store.partition.primary.messagepath -v /store/primary-msg}}
\\
\\
# Configure the index cache record file system to use the recordsize of 4 Kbytes.
\\
\\Starting with Messaging Server 7, the index recordsize is 128 bytes. (Messaging Server 5 and 6 used a smaller index record size). Cache recordsize is usually less than 2 Kbytes. The mboxlist database maximum page size is 8 Kbytes. The default ZFS recordsize is 128 Kbytes. Reducing the recordsize for these file systems can improve performance and reduce incremental snapshot backup size.
\\
\\Configure the index cache record file system to use 4 Kbytes recordsize and the mboxlist database file system to use 8 Kbytes recordsize.
\\
Examples:
\\
{{zfs set recordsize=4k store/primary-idx}}
{{zfs set recordsize=8k store/mboxlist}}
\\
{info:title=Note}
This setting controls the recordsize of newly created files only.{info}
\\
The default recordsize of 128k is appropriate for the message store message file system.\\
\\
# Disable file access time record.\\
The message store does not utilize the file access time. By disabling file access time updates, you reduce unnecessary overhead.
\\
Examples:
\\
{{# zfs set atime=off store/mboxlist}}
{{# zfs set atime=off store/primary-idx}}
{{# zfs set atime=off store/primary-msg}}
\\
\\
# Keep ZFS pool space under 80 percent utilization to maintain pool performance.
\\
ZFS pool performance can degrade when a pool is very full. As the pool approaches 100 percent full, more time is needed to find free space and it is more likely that the free space is available only in small chunks.
\\
Configure the disk usage alarm threshold {{configutil}} parameter {{alarm.diskavail.msgalarmthreshold}} to at least 20, to receive a warning before the disk becomes full. (The default value is 10).
\\
Example:
{{# configutil -o alarm.diskavail.msgalarmthreshold -v 20}}
\\
To enable message throttling sooner, configure the {{configutil}} parameter {{local.store.diskusagethreshold}} to 90.
(The default is 99).
\\
Example:
{{#configutil -o local.store.diskusagethreshold -v 90}}
h2. ZFS Administration Recommendations
* Perform snapshot backup regularly.
\\
Back up the mboxlist database, index, and message file systems atomically by using the {{zfs snapshot -r}} command. Then use the {{zfs send}} and {{receive}} commands, or an enterprise-level backup solution to save the data.
\\
Examples:
\\
{{# zfs snapshot -r store@now}}
{{# zfs send store/mboxlist@now | ssh host2 zfs recv store/mboxlist}}
{{# zfs send store/primary-idx@now | ssh host2 zfs recv store/primary-idx}}
{{# zfs send store/primary-msg@now | ssh host2 zfs recv store/primary-msg}}
\\
You can use {{zfs send -i}} to perform incremental backups. Destroy the snapshots when they are not not needed.
\\
{{# zfs destroy -r store@now}}
Note that ZFS snapshots are for backing up and restoring the entire message store files system. You cannot back up and restore individual mailboxes. However, you can use {{imsbackup}} to back up the snapshot and {{imsrestore}} to restore the mailboxes.
h2. Reference
[http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide]
[http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide]
{panel:borderStyle=none|titleBGColor=#BDBEC0|bgColor=#f5f5f5}
*Update 10/14/09*
This information needs to be updated to include the pros and cons of using ZFS.
{panel}
[ZFS|http://www.sun.com/software/solaris/zfs.jsp] provides the following features that make it ideal for backing up the Messaging Server message store:
* Snapshot backup
* Enables the use of less expensive SATA drives
* Built-in volume manager that enables you to grow file systems dynamically
Topics:
{toc:minLevel=2|maxLevel=2}
h2. Configuration Recommendations for ZFS and Messaging Server
# Separate the Messaging Server mboxlist database, message file, and index cache files on different file systems.
\\
The mboxlist database is a sleepycat database that contains mailbox meta data.
\\
The index cache records ({{store.idx}} and {{store.c*}}) contain meta information about mailboxes and messages. Messaging Server accesses and modifies this meta information, although the modifications tend to be more random and smaller. The location of the index cache records is controlled by the {{configutil}} parameter {{store.partition.}}_partition\_name_{{.path}}, where _partition\_name_ is the name of the partition.
\\
Each message file ({{*.msg}}) represents a single email. Each message file is written to disk once, never modified, read many times (for example, when a user accesses the email, when the messages are backed up, and so on) and may be deleted. By default, these files are stored with the index and cache files. Message files location is controlled by the {{configutil}} parameter {{store.partition.}}_partition\_name_{{.messagepath}}, where _partition\_name_ is the name of the partition.
\\
Separating the message files from the index cache records to different partitions (and underlying file systems) enables you to configure the file system with properties appropriate for the access type.
\\
Examples:
{{# zfs create store/mboxlist}}
{{# zfs set mountpoint=/var/opt/sun/comms/messaging/store/mboxlist store/mboxlist}}
\\
{{# zfs create store/primary-idx}}
{{# configutil -o store.partition.primary.path -v /store/primary-idx}}
\\
{{# zfs create store/primary-msg}}
{{# configutil -o store.partition.primary.messagepath -v /store/primary-msg}}
\\
\\
# Configure the index cache record file system to use the recordsize of 4 Kbytes.
\\
\\Starting with Messaging Server 7, the index recordsize is 128 bytes. (Messaging Server 5 and 6 used a smaller index record size). Cache recordsize is usually less than 2 Kbytes. The mboxlist database maximum page size is 8 Kbytes. The default ZFS recordsize is 128 Kbytes. Reducing the recordsize for these file systems can improve performance and reduce incremental snapshot backup size.
\\
\\Configure the index cache record file system to use 4 Kbytes recordsize and the mboxlist database file system to use 8 Kbytes recordsize.
\\
Examples:
\\
{{zfs set recordsize=4k store/primary-idx}}
{{zfs set recordsize=8k store/mboxlist}}
\\
{info:title=Note}
This setting controls the recordsize of newly created files only.{info}
\\
The default recordsize of 128k is appropriate for the message store message file system.\\
\\
# Disable file access time record.\\
The message store does not utilize the file access time. By disabling file access time updates, you reduce unnecessary overhead.
\\
Examples:
\\
{{# zfs set atime=off store/mboxlist}}
{{# zfs set atime=off store/primary-idx}}
{{# zfs set atime=off store/primary-msg}}
\\
\\
# Keep ZFS pool space under 80 percent utilization to maintain pool performance.
\\
ZFS pool performance can degrade when a pool is very full. As the pool approaches 100 percent full, more time is needed to find free space and it is more likely that the free space is available only in small chunks.
\\
Configure the disk usage alarm threshold {{configutil}} parameter {{alarm.diskavail.msgalarmthreshold}} to at least 20, to receive a warning before the disk becomes full. (The default value is 10).
\\
Example:
{{# configutil -o alarm.diskavail.msgalarmthreshold -v 20}}
\\
To enable message throttling sooner, configure the {{configutil}} parameter {{local.store.diskusagethreshold}} to 90.
(The default is 99).
\\
Example:
{{#configutil -o local.store.diskusagethreshold -v 90}}
h2. ZFS Administration Recommendations
* Perform snapshot backup regularly.
\\
Back up the mboxlist database, index, and message file systems atomically by using the {{zfs snapshot -r}} command. Then use the {{zfs send}} and {{receive}} commands, or an enterprise-level backup solution to save the data.
\\
Examples:
\\
{{# zfs snapshot -r store@now}}
{{# zfs send store/mboxlist@now | ssh host2 zfs recv store/mboxlist}}
{{# zfs send store/primary-idx@now | ssh host2 zfs recv store/primary-idx}}
{{# zfs send store/primary-msg@now | ssh host2 zfs recv store/primary-msg}}
\\
You can use {{zfs send -i}} to perform incremental backups. Destroy the snapshots when they are not not needed.
\\
{{# zfs destroy -r store@now}}
Note that ZFS snapshots are for backing up and restoring the entire message store files system. You cannot back up and restore individual mailboxes. However, you can use {{imsbackup}} to back up the snapshot and {{imsrestore}} to restore the mailboxes.
h2. Reference
[http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide]
[http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide]