[syslog-ng]Syslog-ng + Mysql problems

Vladimir Potapov syslog-ng@lists.balabit.hu
Wed, 23 Mar 2005 12:58:41 +0300


On loghost as log store I'm using syslog-ng-1.6.5-2 + mysql-4.0.21-4. OS is
Suse-9.2.
After configuring database and syslog-ng.conf and start script which send
logs to mysql from FIFO, I see the following mysql error : ERROR 1040: Too
many connections.
Part of syslog-ng.conf where the only local log send to FIFO:

destination d_mysql_local {
         pipe("/var/log/mysql.pipe"
         template("INSERT INTO logs (host, facility, priority, level, tag,
datetime, program, msg)
    VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG',
'$YEAR-$MONTH-$DAY $HOUR:$MIN:        	$SEC', '$PROGRAM', '$MSG' );\n")
      template-escape(yes)); };
      log { source(src); destination(d_mysql_local); };

Loghost have about 10-20 local log messages per minute. Database use only
for syslog queries and the load of server CPU about 10% .

Script which sends log from FIFO to Mysql :
#!/bin/bash
  if [ -e /var/log/mysql.pipe ]; then
     while [ -e /var/log/mysql.pipe ]
     do
       mysql -u syslog --password=secret syslog < /var/log/mysql.pipe
     done
 else
     mkfifo /var/log/mysql.pipe
 fi

server:/bin # ls -la /var/log/mysql.pipe
prw-------  1 root root 0 2005-03-23 12:53 /var/log/mysql.pipe

I try to increase max_connection to 500 but this don't solve the problem.
Have anyone the same problems?

I have the same installation on FreeBSD-5.3p5 and have no problems.