txn performance penalty

David Relson relson at osagesoftware.com
Tue Nov 16 02:29:52 CET 2004


On Mon, 15 Nov 2004 08:37:46 -0500
Greg Louis wrote:

> Calendar time, on an otherwise idle machine with 512Mb RAM and 1Gb
> swap, to process 545 spam starting after cold boot (memory is clear):
> 
> 0.92.8: 51 seconds
> 0.93.1 with defaults: 489 seconds
> 0.93.1 with DB_TXN_NOT_DURABLE: 492 seconds
> 
> This was with db-4.2.52.  Processing involved scoring each message
> individually (with formail) and then scoring the same mbox with a
> single bogofilter run (-vM).  The idea is to scan the spams and
> register any false negatives, then rescan to check the result; but in
> these runs there were no fn and so no messages were registered.  Yet
> all the __db.* files, lockfile-p and wordlist.db were updated during
> the 0.93.1 runs.  The bulk of the time was consumed in disk activity.

...[snip]...

Matthias,

I've spotted something odd in function lookup() in file score.c.  In
outline form, the code is:

    for (list=word_lists; list != NULL; list=list->next)
    {
	ds_txn_begin(list->dsh)
	ret = ds_read(list->dsh, token, &val);
	ds_txn_commit(list->dsh)
    }

Why is ds_read() wrapped in a transaction?

David



More information about the bogofilter-dev mailing list