DSPAM and Postgres

./configure --enable-preferences-extension
            --with-storage-driver=pgsql_drv

Note that currently, dspam-web does not talk to postgresql, so stats and preferences will not carry over.

Note: If you want to use dspam with PostgreSQL for a high-volume of mail, you should use version 3.6 or higher and PostgreSQL 8.0 or higher in order to take advantage of a PL/SQL function to retrieve token data resulting in about a 3x speed improvement.

The biggest performance bottleneck is disk I/O for both reading and writing, so for maximum scalability, use the fastest SCSI disks possible, and do NOT use a 3-disk RAID 5 (which has 50% write performance of a single drive), but go for a striping raid, and then mirror that (with RAID 10 or DRBD, etc.).

Since disk I/O is a major problem in performance, it is best to throw lots of RAM at your PostgreSQL server. If PostgreSQL can cache and share the tables in memory, you will not have disk I/O problems. There is specific tuning options here: http://www.edoceo.com/liber/db-postgresql-performance.php. Primarily, you want to have a large amount of physical ram, and you want to increase your shared memory. For example, on a 2.5 GB memory system, I added "echo $((1024 * 1024 * 1536)) > /proc/sys/kernel/shmmax" to my postgres startup script to increase the amount of shared memory maximum under Linux to 1.5 GB. Then, in postgresql.conf I set "shared_buffers = 131072" which is about 1 GB of shared memory. PostgreSQL will use a total value greater than that set in shared buffers, so the Linux maximum should exceed the PostgreSQL maximum. You can use the "ipcs" and "top" commands under Linux to view how shared memory is being used.


I've written a little howto documenting setting up DSPAM, Postgres and Procmail: Installation/PostgresProcmail. SamMason

last edited 2006-04-12 17:49:39 by JeremyTaylor