Quotas and disk usage

Wil Cooley wcooley at nakedape.cc
Thu Jan 14 14:26:29 EST 2010


Adam Tauno Williams wrote:

> Some earlier versions of Cyrus had quota calculation issues with big
> quotas (2GB? 4GB?) or big mailboxes.  I think there is a blurb in WMOGAG
> about that, and what version fixed it.

It happens with 2.2 crossing the 4GiB range, but not related to what he's seeing.

>> bash-3.00$ /opt/cyrus-imap/bin/quota -f user.user1
>>    Quota   % Used     Used Root
>>  5242880       63  3303494 user.user1
>> bash-3.00$ /opt/cyrus-imap/bin/quota -f user.user2
>>    Quota   % Used     Used Root
>>  41943040       93 39410366 user.user2
>> bash-3.00$ du -sh user1
>>  7.6G   user1
>> bash-3.00$ du -sh user2
>>  6.4G   user2
> 
> Do you have delayed expunge enabled?  If so actual disk size may very
> well exceed quota values - because the expunged-but-not-yet-expired
> messages are still on the disk.

Other possible contributors:
 o Squatter indexes (my estimation is that they add 50%)
 o Directory sizes themselves
 o Other cyrus.* metadata

You can use something like this to calculate just the total (sorry, you need GNU
du, find and xargs):

find `mbpath user.user1` -type f -name \*. -print0 \
	|xargs -0 du -cm|awk '/total/ { tot=tot+$1 } END { print tot "MiB" }'

You need the awk if there are more files than possible for a single invocation
of "du". And you can calculate the metadata overhead by negating the "-name"
parameter:

find `mbpath user.user1` -type f \! -name \*. -print0 \
	|xargs -0 du -cm|awk '/total/ { tot=tot+$1 } END { print tot "MiB" }'

Wil

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20100114/00472d5b/attachment-0001.bin 


More information about the Info-cyrus mailing list