On Sat, 12 Jun 2004, Tim Bishop wrote: > I've been deploying a new system that uses SpamAssassin with an SQL > database for user config, auto-whitelists, and bayesian databases. > > I started off with Postgresql because that's the current database system > we use. I was disappointed with the performance - it sometimes ran into > minutes per message when autolearning. Normal processing was OK, but > when a message was autolearnt it when hideously slow. > > At this point I tried MySQL. I was gobsmacked at the performance > difference. Admittedly I thought it might go a bit quicker, maybe even > twice as fast, but it was more like 10-100 times as fast. > > With postgresql the database server was maxed out on CPU and IO, and the > spam server had a handful of spamd processes consuming about 5% CPU > each. With mysql this changed to the spam server being maxed out on CPU > and the database server practically idle.
It's quite a task to tune PostgreSQL, and out of the box it comes horribly badly tuned. Also you have to make very good use of transactions with PostgreSQL in order to get good performance, which I suspect we're not doing. Also you have to use high concurrency to really see benefits (it scales much better with more concurrent clients than MySQL does). All those things are probably working against your setup. Matt.
