Mathias Posted February 7, 2016 Posted February 7, 2016 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.
d00p Posted February 7, 2016 Posted February 7, 2016 Klingt nett, wie wärs mit nem Pull-Request auf Github?
Guest Posted June 9, 2016 Posted June 9, 2016 Well... This is not a workaround. Sharing connections is the recommended configuration.Doing a connect+close for every query would reduce performance on a high-volume server. Source: http://postfix.1071664.n5.nabble.com/postfix-with-mysql-too-many-connections-td81836.html
Question
Mathias
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:
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
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.
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.