Message store statistics

Is there a command that displays message store usage by partition? Specifically, the current space used and the number of users per partition? This would be extremely helpful for balancing the number of users between partitions for backup purposes.

Ourimsimta version info:

Sun Java(tm) System Messaging Server 6.2-7.05 (built Sep 5 2006)

libimta.so 6.2-7.05 (built 12:18:44, Sep 5 2006)

[420 byte] By [jalongino3a] at [2007-11-27 2:22:38]
# 1
space used? I personally like the df command. . . Number of users? have a look at the mboxutil command, or work through ldapsearch.
jay_plesseta at 2007-7-12 2:27:13 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 2

df doesn't have enough granularity. There are multiple MTA partitions and non-MTA folders on the same ufs disks. Using du -ks takes way too long to be of any real use. There are 40k users and about 500GB store.

Although we only have 3 partitions now, we look to expand (I'm guessing at least 10 partitions) to be able to run imsbackup in parallel. That would make scraping mboxutil or working through ldapsearch kind of nasty. I was really hoping for an existing command or something that came close.

I'll probably stick with my current method of scraping imquotacheck, break processing mboxutil against each line to determine the user partition and accumulating the various totals. Even this way is very slow.

jalongino3a at 2007-7-12 2:27:13 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3

Hi,

I'm with Jay on this one:

>> Is there a command that displays message store usage by partition?

Message store usage is a tricky beast. Due to single-message-copy where identical messages on a partition are hard-linked (to save space), if you add up the usage from mboxutil output that with not equal the usage on disk.

So df -k can be the easiest to determine usage on _disk_ but this may not be the same as imsbackup usage (since that works on usage per _user/folder_) - this of course assumes you are using a file-system-per-partition model.

NB: have a look at the documentation regarding the relinker utility, which is designed to restore the hard-links if they happen to be 'broken' e.g. through IMAP based account migrations.

>> Specifically, the current space used and the number of users per

>> partition?

You can use ldapsearch and find out the number of users/partition based on the mailhost/mailmessagestore parameters, but there are three downsides to this:

1. It's hard on the directory server, and unless you use a super-user account you may not get all the results back (standard non-directory manager DN's are limited to 1000 returned results)

2. Your mailmessagestore partition value may be incorrect/inconsistent with where the users account is actually located

3. Orphan accounts (those which haven't been removed from the mailstore itself after being deleted from LDAP) won't be returned

So you best option would be to take the output of mboxutil -l and run it through a bit of perl/scripting magic to get your numbers.

Regards,

Shane.

shane_hjortha at 2007-7-12 2:27:13 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 4

We're not using a file-system-per-partition model. so df -k isn't helpful.

After some thought, I rewrote my script to use the results of mboxutil. Using several grep commands allows me to get the user counts by partition. Granted this introduces a very small possibility for error if there are user folders or files that contain the partition name with a blank on either side, but it is unlikely and would still give ballpark numbers. Trying to achieve the same results without using grep would be painful.

The finished program takes less than 2 minutes to run, so it's much more efficient than the method I used previously (imquotacheck & mboxutil).

Thanks to both of you for the input.

jalongino3a at 2007-7-12 2:27:13 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...