PDA

View Full Version : Lots of errors / MySQL overload


ande
26th August 2011, 09:17
Hi there,

I get a lot of messages like

PHP Warning: mysql_errno() expects parameter 1 to be resource, boolean given in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 63
PHP Warning: mysql_error() expects parameter 1 to be resource, boolean given in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 64
PHP Warning: mysql_connect(): Too many connections in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 78
PHP Warning: mysql_errno() expects parameter 1 to be resource, boolean given in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 63
PHP Warning: mysql_error() expects parameter 1 to be resource, boolean given in /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php on line 64

OK, those may be "only" warnings, but I wanted to report them regardless.

What bothers me more is a lot of unavailability of MySQL from ClamAV:

Aug 26 00:41:45 eins postfix/error[25316]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 00:41:45 eins postfix/error[25320]: warning: connect to mysql server 127.0.0.1: Too many connections
Aug 26 00:41:45 eins postfix/error[25320]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 00:41:45 eins postfix/master[29367]: warning: process /usr/lib/postfix/error pid 25286 exit status 1
Aug 26 00:41:45 eins postfix/master[29367]: warning: /usr/lib/postfix/error: bad command startup -- throttling
Aug 26 00:41:45 eins postfix/qmgr[24239]: warning: private/retry socket: malformed response
Aug 26 00:41:45 eins postfix/qmgr[24239]: warning: transport retry failure -- see a previous warning/fatal/panic logfile record for the problem description
Aug 26 00:41:45 eins postfix/qmgr[24239]: warning: connect to mysql server 127.0.0.1: Too many connections
Aug 26 00:41:45 eins postfix/qmgr[24239]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 00:41:45 eins postfix/master[29367]: warning: process /usr/lib/postfix/error pid 25292 exit status 1
Aug 26 00:41:45 eins postfix/master[29367]: warning: process /usr/lib/postfix/error pid 25297 exit status 1

And this:

Aug 26 00:41:46 eins postfix/master[29367]: warning: process /usr/lib/postfix/error pid 25315 exit status 1
Aug 26 00:41:46 eins postfix/master[29367]: warning: process /usr/lib/postfix/error pid 25316 exit status 1
Aug 26 00:41:46 eins postfix/master[29367]: warning: process /usr/lib/postfix/error pid 25320 exit status 1
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/smtpd[23935]: warning: mysql:/etc/postfix/mysql-virtual_recipient.cf: table lookup problem
Aug 26 00:41:46 eins postfix/master[29367]: warning: process /usr/lib/postfix/qmgr pid 24239 exit status 1
Aug 26 00:41:47 eins amavis[25305]: (25305-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=dbispconfig;host=127.0.0.1;por t=3306': Too many connections
Aug 26 00:41:47 eins amavis[25305]: (25305-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 103) line 241, line 5.
Aug 26 00:41:47 eins amavis[25305]: (25305-01) (!)Requesting process rundown after fatal error
Aug 26 00:41:47 eins postfix/smtp[25296]: warning: connect to mysql server 127.0.0.1: Too many connections
Aug 26 00:41:47 eins postfix/smtp[25296]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 00:41:47 eins amavis[25334]: (25334-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=dbispconfig;host=127.0.0.1;por t=3306': Too many connections
Aug 26 00:41:47 eins amavis[25334]: (25334-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 103) line 241, line 5.
Aug 26 00:41:47 eins amavis[25334]: (25334-01) (!)Requesting process rundown after fatal error
Aug 26 00:41:47 eins postfix/smtpd[23441]: warning: 63.168.93.7: hostname corporat063-168093007.sta.intercable.net.co verification failed: Name or service not known
Aug 26 00:41:47 eins postfix/cleanup[23798]: warning: BDAD310253F: virtual_alias_maps map lookup problem for webmaster@xxxx.de
Aug 26 00:41:47 eins amavis[24882]: (24882-20-3) (!)SEND via SMTP: -> ,ENVID=AM..20110825T224147Z@eins.xxxxx.net 451 4.3.0 TempFailed, id=24882-20-3, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error

How can I tweak the resources so this won't happen? I have 8 GB RAM, 4 core processor and so far not many domains on it.

till
26th August 2011, 09:58
Edit the mysql my.cnf file and set max_connections and max_user_connections to 500 and restart mysql.

ande
26th August 2011, 10:10
I'll give it a try. I had upp'ed max_connections to 200 already but didnt know about max_user_connections. Many thanks!

ande
26th August 2011, 11:52
I'm sorry I have to return but still got many log entries like:


Aug 26 11:38:45 eins postfix/trivial-rewrite[2715]: warning: transport_maps lookup failure
Aug 26 11:38:45 eins postfix/trivial-rewrite[2715]: warning: transport_maps lookup failure

Plus, at the moment my mail queue is rather full, mail log says reasons mostly like:

unknown mail transport error

To be honest, I am currently testing the performance of the mail server: I have a honeypot that generates random nonexistant mail addresses for one domain (I can turn MX for that domain off for I usually dont use mail on that domain) and displays it on a webpage. For sure the crawler bots harvest that and then try to send all sorts of SPAM and virusses. I get a lot of attempts to send mail, most of them get blocked by postfix already. The server load is still below 0.2 ...

Amavis still cries in its pillow:

Aug 26 11:36:42 eins amavis[2649]: (02649-01) (!!)TROUBLE in check_mail: quar+notif FAILED: temporarily unable to notify admin: 451 4.3.0 TempFailed, id=02649-01, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error at /usr/sbin/amavisd-new line 12953.
Aug 26 11:36:42 eins postfix/smtp[2692]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 11:36:43 eins postfix/error[2689]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 11:36:44 eins postfix/qmgr[2693]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 11:36:52 eins postfix/trivial-rewrite[2659]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Aug 26 11:37:07 eins postfix/trivial-rewrite[2707]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Aug 26 11:38:20 eins amavis[2649]: (02649-08) (!!)TROUBLE in check_mail: quar+notif FAILED: temporarily unable to notify admin: 451 4.3.0 TempFailed, id=02649-08, from MTA([127.0.0.1]:10025): 451 4.3.0 Error: queue file write error at /usr/sbin/amavisd-new line 12953.
Aug 26 11:38:20 eins postfix/smtp[2726]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem

falko
27th August 2011, 12:16
Which distribution do you use? Does your Postfix have MySQL support compiled in?

What's the output of netstat -tap, and what's in /etc/postfix/mysql-virtual_relaydomains.cf?