Jump to content
Froxlor Forum
  • 0

[solved] Too many connections (mysql) - Postfix sleeping processes - lookup error


Mathias

Question

Hallo,

 

ich benutze Postfix mit policyd-weight und selektivem Greylisting über postgrey.

 

Leider kam es immer wieder zu MySQL-Fehlern durch "Too many connections", obwohl ich schon in der my.cnf "max_connections = 500" gesetzt habe.

Entsprechend erhielt der postmaster Mails :Postfix SMTP server: errors from ....

In der mail.log fand sich:

warning: mysql:/etc/postfix/mysql-virtual_alias_maps.cf lookup error for "adresse@domain.de"
warning: DD03C2982F24: virtual_alias_maps map lookup problem for adresse@domain.de -- message not accepted, try again later

 

Ein "mysqladmin -pPASSWORT extended-status | grep -wi 'threads_connected\|threads_running' | awk '{ print $2,$4}'" zeigte mir mehrere hundert offene Verbindungen, 

mit ' mysql -pPASSWORT -e "show processlist;" ' fand ich hunderte Prozesse im Status Sleep auf meine froxlor-Datenbank.

 

Ursache: Postfix hält die Abfragen während der Mail-Bearbeitung offen.

Abhilfe: Postfix zur Verwendung von proxymap umkonfigurieren.

 

In der /etc/postfix/main.cf

proxy_read_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf,
                  proxy:mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf,
                  proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf,
                  proxy:unix:passwd.byname

virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_alias_maps.cf

Jetzt sind nur noch weniger als 10 offene MySQL-Prozesse übrig und alles läuft wieder rund.

 

Diese Anpassung könnte man sicher auch in's Froxlor aufnehmen, denn Google zeigt, dass schon häufiger nach diesem Fehler gesucht wurde.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...