[Dovecot] ext3/ext4 performance issue
Timo Sirainen
tss at iki.fi
Sat May 16 00:29:59 EEST 2009
On Fri, 2009-05-15 at 17:13 -0400, Timo Sirainen wrote:
> > I could run stats here, with 12.000 users to see what the average size
> > is...
>
> It would be interesting to have some kind of statistics for cur/
> directories and get <cur directory size> divided by <number of files in
> cur> and then see how many users have values that are much higher than
> average (i.e. how many users have had tons of mails that have since been
> deleted).
I wrote an ugly script for it, just change the "find ." path to wherever
your maildirs are and run in some temp directory:
### total.sh
#!/bin/sh
find . -name cur -exec ./diravg.sh {} \; > log
count=`cat log|wc -l`
avg=`cat log | awk '{print $2"+"}'|tr -d '\n'|sed 's/^/(/'|sed "s,+\
$,)/$count\n,"|bc -l`
echo "average: $avg"
echo "3x higher:"
cat log | perl -ne "@l = split(/ /); print if \$l[1] >= ($avg*3);"
### diravg.sh
#!/bin/sh
dir=$1
files=`/bin/ls $dir|wc -l`
if [ $files = 0 ]; then
files=1
fi
ls -ld $dir|head -1|awk "{print \"$dir \" (\$5 / $files);}";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090515/8756fc59/attachment.bin
More information about the dovecot
mailing list