[sr-dev] kamailio gets frozen when rsyslog-mysql cannot send the SQL query

Olle E. Johansson oej at edvina.net
Wed Jul 28 17:41:28 CEST 2010


28 jul 2010 kl. 17.36 skrev Jon Bonilla (Manwe):

> El Wed, 28 Jul 2010 17:29:42 +0200
> Iñaki Baz Castillo <ibc at 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

THis is great advice, thanks!

Found these docs:
http://www.rsyslog.com/doc/queues.html

/O


More information about the sr-dev mailing list