[Mimedefang] Mail::SpamAssassin::BayesStore::SQL database persistence.
Sevo Stille
sevo at radiox.de
Wed Jul 20 07:24:13 EDT 2005
Matthew Schumacher wrote:
> In fact I looked that the performance benchmarks on the spamassassin
> site: http://wiki.apache.org/spamassassin/BayesBenchmarkResults and they
> show postgres to be a terrible performer which would be true if the are
> not using persistent database connections.
Going through SpamAssassin/BayesStore/SQL.pm, it rather looks as if SA
were reusing any existing connection - that is, if SA is called
persistently, so will its connections. Don't know whether the MD method
of calling SA spoils that, though.
At any rate with my installation, SA/pg seems to be mostly slowed down
by the fact that the database is poorly indexed - indexing the most
significant search fields (bayes_seen(msgid), bayes_token(token) and id
throughout all tables) and doing a vacuum optimize run did improve
performance quite significantly.
> So the question is, is there a way to make SA use persistent
> connections?
If the SA instances get scrapped, you could replace the DBI->connect
call with DBI->connect_cached, and disable the corresponding disconnect.
> I read though the docs and didn't see anything. Perhaps a
> way to create a persistent connection in MD and pass it to the SA module?
That would create a interdependency between MD and a modification to MD
- very ugly in terms of maintenance.
Sevo
More information about the MIMEDefang
mailing list