<<< Date Index >>>     <<< Thread Index >>>

Re: Mark messages in mailbox as read without massive performance hit?!



On Thu, Dec 29, 2005 at 07:18:55AM +0100, Stanislaw Halik wrote:
> Derek Martin <invalid@xxxxxxxxxxxxxx> wrote:
> > But 1000 messages isn't 50,000 messages.  Try again with that number
> > and see how well you do.  You might be surprised, even on FreeBSD's
> > optimized filesystem.
> 
> 17 seconds. unfortunately, I haven't got any mboxes of that size to
> compare results.

If you can do this on your own mail server, so that you won't risk
making your system administrator very very angry, you can create such
a mailbox with this script:

=-=-=-=-=-=-=-=
#!/bin/sh

i=0
while [ $i -lt 50000 ]; do
        i=`expr $i + 1`
        cat <<EOF | mail -s "test message $i" youraddress@xxxxxxxxxxx

This is a test message.  It is message #$i of 50,000.  This line is
some filler text.  It is only here to make the e-mail message a bit
longer so that this test is not totally unrealistic.  The average
e-mail message without any attachments is probably around two
kilobytes or so, so we want to try to make a test message that is
approximately around that size.  It doesn't really matter what's in
the e-mail, nor does it matter how the e-mail is formatted.  It
could be formatted in nice neat columns fully justified, or it could
be one long line that has four kilobytes of text in it.  But we like
to have lines that are reasonable line lengths, so that they are
easier to read and easier to edit.  We are not replying to anyone
else's message, so we don't need to worry about whether or not we
are top-posting, or quoting too much of the message, or any of that
other kind of stuff that often irritates a lot of e-mail users.  All
we need to do is make an e-mail message of sufficient size.

This is a test message.  It is message #$i of 50,000.  This line is
some filler text.  It is only here to make the e-mail message a bit
longer so that this test is not totally unrealistic.  The average
e-mail message without any attachments is probably around two
kilobytes or so, so we want to try to make a test message that is
approximately around that size.  It doesn't really matter what's in
the e-mail, nor does it matter how the e-mail is formatted.  It
could be formatted in nice neat columns fully justified, or it could
be one long line that has four kilobytes of text in it.  But we like
to have lines that are reasonable line lengths, so that they are
easier to read and easier to edit.  We are not replying to anyone
else's message, so we don't need to worry about whether or not we
are top-posting, or quoting too much of the message, or any of that
other kind of stuff that often irritates a lot of e-mail users.  All
we need to do is make an e-mail message of sufficient size.

EOF

done
-=-=-=-=-=-=-=-=-=-=-

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

Attachment: pgpIZRDJ0NS9S.pgp
Description: PGP signature