PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Spamassassin - nach ca. 3 Monaten (~viel Spam) lahmt alles (MySql/Bayes/autolearn)



d@tenmaulwurf
28.11.06, 07:05
Hallo!

Wir haben derzeit Spamassassin auf spamd/spamc-Basis mit Postfix am laufen.
Funktioniert auch alles sehr gut, nur, dass mit aktivierter bayes- und autolearn-Funktion, nach ca. 3 Monatenn (in welchen extrem viel Spam bei uns rübergeht) die Scanzeit extrem in die Höhe schießt.
Scheinbar ist die MySQL-Datenbank hierfür nicht ausgelegt (es sind mehrere hundertmillionen Einträge in der bayes_token) und darunter leidet stark die Mailzustellung (braucht ab diesem Zeitpunkt über 3 Std. um ausgeliefert zu werden oder aufwärts).
Jetzt die Frage - was ist besser? Einen eigenen SQL-Serevr aufzusetzen nur für Spamassassin? Wenn ja, welchen SQL-Server? Mit welchen Optionen?
Wenn nicht, was dann? SA's eigenes ASCII-file-format?
Was kann man sonst tun?
Und die Tabelle - wenn denn grad ma ordentlich angelernt wurde und gefiltert wird - immer zu leeren ist ja nun wirklich nicht der Sinn der autolearn-/bayes-Funktion.

Vielen Dank im voraus,

d@tenmaulwurf

marce
28.11.06, 07:13
was ist es denn für eine Maschine, was tut der alles (Prozesse, Load, Durchsatz, ...) und wie groß ist die DB?

... und dann könnte man evtl. mal über Optimierung nachdenken - eine Standardinstallation der MySQL bietet da recht viel Potential...

d@tenmaulwurf
28.11.06, 08:58
Die SA-Datenbank müssen wir ungefähr bei rund 800MB leeren (kann aber abweichen, haben sie immer gelöscht, wenn die Mailzustellung zu lange dauerte (nicht die professionellste Lösung, ich weiß)).
Die Maschine ist eine 3,2 GHz intel xeon Maschine mit 3 GB RAM und der SA-Daemon "spamd" und MySQL erzeugen die höchste Last. MySQL zum größtenteil aufgrund der Queries vom spam-Daemon.
Hinzu kommen Apache, Postfix, Courier.
Die CPU idled jedoch im Schnitt bei rund 30%.

marce
28.11.06, 09:00
Loadanteil von MySQL?

Klingt aber danach, wie wenn man über QueryCaches und ähnliches noch viel herausholen könnte...

Poste doch mal die my.cnf...

d@tenmaulwurf
28.11.06, 15:46
[...]
# The MySQL server
[mysqld]
max_connections = 800
port = 3306
socket = /tmp/mysql.sock

skip-locking
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

[...]

# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 384M
#bdb_max_lock = 100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /customers/mysql/
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = /customers/mysql/
#innodb_log_arch_dir = /customers/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


Vielen Dank im voraus.

marce
28.11.06, 16:07
Punkt 1: Braucht ihr das MySQL-Logging?

... ansonsten - als erstes den Query-Cache z.B. einfach mal auf 512 MB erhöhen, die anderen Buffer auch hochsetzen - schau mal in der mySQL-Doku, da sind ein paar recht gute Beispiele für Rechner mit mehr als 2GB Hauptspeicher...

(oder hier im Forum mal nach MySQL-Optimierung suchen)