El Wed, 28 Jul 2010 17:29:42 +0200 Iñaki Baz Castillo ibc@aliax.net escribió:
- Then kamailio tries to log to syslog. rsyslog receives the request
and tries to send it via MySQL. Unfortunatelly it gets frozen as the DB doesn't work, and it neither writes the log to the local log file !!! (this is really surprising to me).
If the entry for mysql is before the entry for the local file, it's not surprising.
- Worse is the fact the rsyslog replies nothing to kamailio process so
the kamailio process gets 100% *blocked* waiting for the response (this is what I suspect).
- As a dirty workaround, stopping the local rsyslog server makes
kamailio to work again.
A better workaround is to have queue support in rsyslog. Messages are stored in memory and in a disk queue and they are pushed to the db when the connection is recovered.
Try something like this in your rsyslog.conf configuration:
# Memory and disk Queuing support $WorkDirectory /var/log/queue $ActionQueueType LinkedList $ActionQueueFileName SL $ActionQueueMaxDiskSpace 4g $ActionQueueSaveOnShutdown on $ActionResumeRetryCount -1
So, I think this is mostly a bug in rsyslog-mysql as it shouldn't get frozen if the MySQL server doesn't work. However I also think that Kamailio should not depend on it, and perhaps it shouldn't wait indefinitely for the rsyslog response. What do you think? Would make sense a "ping" mechanism like with RtpProxy servers in order to enable/dissable the syslog logging?
I think this is not kamailio's fault. Kamailio just uses syslog services and it's up to syslog server to be fault tolerant.
My $0,02