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

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



On Thu, Dec 29, 2005 at 02:12:57AM -0500, Derek Martin wrote:
> > 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:
> 
> Yeah, uh... don't run that script.  Sorry!  You'll bomb your system.

If you have somewhat old hardware, you can run the script if you add a
sleep 1 in the loop.  If it's really old and slow, you might need to
do more like sleep 2 or sleep 5...

If your hardware is new and fast (especially fast disk), you can
probably do about 10 messages a second.  If you're on a beefy server
class machine, you can probably do a lot more than that.  

At 1 message/second it will take you about 14 hours to generate a
mailbox with 50,000 messages using this script.

to do more than that, add this inside the loop:

-=-=-=-=-=-=-

# number of messages to do per second
rate=10

foo=`expr $i % $rate`
if [ $foo -eq 0 ]; then
        sleep 1
fi

-=-=-=-=-=-=-=-=-

The above sets the rate of messages to 10/s.  That is, the script will
sleep for 1 second after submitting 10 messages.  At that rate, it
will only take about an hour and a half to generate 50,000 messages.

My sincere apologies to anyone who may have run the original script I
posted and hosed their system.

-- 
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: pgpHKhMbxA8uQ.pgp
Description: PGP signature