Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2001 13:02:57 -0600 (CST)
From:      "Vlad Marchenko" <mv@sumdu.edu.ua>
To:        <freebsd-stable@FreeBSD.ORG>
Subject:   syslog lose lines in log
Message-ID:  <20011210190257.8D8EB3BB384@manager.sendoutmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

Need advise on my problem. I have mail application that sends a lot of lines
to MAIL log: 100+ lines per second. Since we have stats based on analyzing
maillog, it's important for us to have ALL lines. I noticed that under that
load, syslog lose at least 30-40% of all lines. Digging the situation I
found that it happens because DGRAM kind of socket used for delivering
messages to syslogd by syslog(3).
OK, I've installed /usr/ports/system/syslog-ng that supports STREAM unix
sockets,  and patched  /usr/src/lib/libc/gen/syslog.c to have SOCK_STREAM
type of socket when opening socket in function connectlog():

static void
connectlog()
{
        struct sockaddr_un SyslogAddr;  /* AF_UNIX address of local logger
*/

        if (LogFile == -1) {
                if ((LogFile = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
                        return;
                (void)_fcntl(LogFile, F_SETFD, 1);
        }
....

BUT IT STILL LOSES LINES!!! Guys, any ideas?

p.s. the same application DOESNT lose lines to /var/log/maillog when I run
it on linux
p.p.s. system is FreeBSD 4.4-STABLE, all system settings (like max open
files, mbufs, etc) are ok... at least nothing in /var/log/messages

Thanks in advance.

--
Best Regards,
Vlad Marchenko



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011210190257.8D8EB3BB384>