<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Log dropping in Syslog-ng in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90812#M18878</link>
    <description>&lt;P&gt;Cleared netstat counters.  After 15 minutes here is the output from netstat -su&lt;/P&gt;

&lt;P&gt;[root@HO-SPLUNKFW1 ~]# netstat -su&lt;BR /&gt;
IcmpMsg:&lt;BR /&gt;
    InType8: 549&lt;BR /&gt;
    OutType0: 549&lt;BR /&gt;
    OutType3: 6&lt;BR /&gt;
Udp:&lt;BR /&gt;
    851624 packets received&lt;BR /&gt;
    6 packets to unknown port received.&lt;BR /&gt;
    541184 packet receive errors&lt;BR /&gt;
    834 packets sent&lt;BR /&gt;
IpExt:&lt;BR /&gt;
    InMcastPkts: 16&lt;BR /&gt;
    OutMcastPkts: 17&lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2012 20:02:40 GMT</pubDate>
    <dc:creator>jodros</dc:creator>
    <dc:date>2012-03-13T20:02:40Z</dc:date>
    <item>
      <title>Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90809#M18875</link>
      <description>&lt;P&gt;Following on from; &lt;A href="http://splunk-base.splunk.com/answers/7001/udp-drops-on-linux"&gt;http://splunk-base.splunk.com/answers/7001/udp-drops-on-linux&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Are any of you showing drops for syslog-ng in /var/log/messages?  I believe we are experiencing syslog drops and trying to determine the best way to correct it.  It is my understanding that is syslog-ng is dropping logs, than it would show in the /var/log/messages.  I do not see any drops, only processes.  We are processing on average 25k syslog messages every minute, but sometimes spike to 50k a minute.  I do not know, however, if it would show the linux UDP kernel buffer dropping messages.  Right now, syslog-ng is configured with default settings and no linux kernel UDP buffer adjustments have been made.&lt;/P&gt;

&lt;P&gt;Any assistance would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 12:53:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90809#M18875</guid>
      <dc:creator>jodros</dc:creator>
      <dc:date>2012-03-13T12:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90810#M18876</link>
      <description>&lt;P&gt;This probably isn't the right forum for this type of question.  I suggest you try a forum more orientated to OS level support vs Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 13:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90810#M18876</guid>
      <dc:creator>Brian_Osburn</dc:creator>
      <dc:date>2012-03-13T13:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90811#M18877</link>
      <description>&lt;P&gt;Agreed, that you'll probably get better support in a forum more dedicated to syslog-ng questions. That said, we had similar issues a while back (before upgrading our syslog-ng collector box). When it was running on a dual core Xeon with 4GB of RAM (32bit CentOS 5.8) still, we had good results by changing the following configs. In syslog-ng.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;options {
        keep_hostname(yes);
        flush_lines(200);
        log_fetch_limit(200);
        log_fifo_size(5000);
        time_sleep(20);
        stats_freq(120);
};
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then, for the UDP and TCP segments of the "source" blocks, the&lt;BR /&gt;
so_rcvbuf option needs to be included (as otherwise it has a ridiculous&lt;BR /&gt;
default of "0" for this):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source s_remote {
        tcp(ip(0.0.0.0) port(514) max-connections(1000) keep-alive(yes) so_rcvbuf(16777216));
        udp(ip(0.0.0.0) port(514) so_rcvbuf(16777216));
};
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know the so_rcvbuf was a major factor in taking care of the packet drops we were seeing. And the other options (specifically log_fetch_limit, flush_lines and time_sleep) helped bring down the overall CPU usage of syslog-ng dramatically. Also note that the latest syslog-ng has an option to run multi-threaded. We haven't tried this yet, but it should improve performance I'd think.&lt;/P&gt;

&lt;P&gt;In addition, if you're running a Linux kernel older than 2.6.18 (CentOS 4.x or 5.x... 6.x doesn't apply), some parameters in /etc/sysctl.conf need to be added/tweaked and then reboot the system:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;net.core.rmem_max = 8738000
net.core.wmem_max = 6553600
net.ipv4.tcp_rmem = 8192 873800 8738000
net.ipv4.tcp_wmem = 4096 655360 6553600
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should do it.&lt;/P&gt;

&lt;P&gt;Prior to all this, you should check "netstat -us" and "netstat -ts" to get a sense of how bad the packet loss is or isn't. This way you can also gauge the improvement any of these tweaks might make.&lt;/P&gt;

&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90811#M18877</guid>
      <dc:creator>tmeader</dc:creator>
      <dc:date>2020-09-28T11:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90812#M18878</link>
      <description>&lt;P&gt;Cleared netstat counters.  After 15 minutes here is the output from netstat -su&lt;/P&gt;

&lt;P&gt;[root@HO-SPLUNKFW1 ~]# netstat -su&lt;BR /&gt;
IcmpMsg:&lt;BR /&gt;
    InType8: 549&lt;BR /&gt;
    OutType0: 549&lt;BR /&gt;
    OutType3: 6&lt;BR /&gt;
Udp:&lt;BR /&gt;
    851624 packets received&lt;BR /&gt;
    6 packets to unknown port received.&lt;BR /&gt;
    541184 packet receive errors&lt;BR /&gt;
    834 packets sent&lt;BR /&gt;
IpExt:&lt;BR /&gt;
    InMcastPkts: 16&lt;BR /&gt;
    OutMcastPkts: 17&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2012 20:02:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90812#M18878</guid>
      <dc:creator>jodros</dc:creator>
      <dc:date>2012-03-13T20:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90813#M18879</link>
      <description>&lt;P&gt;I appreciate everyone's input.  Leveraging netstat -us and noting UDP packet receive errors, and after some trial an error, I was able to find the settings to resolve our issues with syslog drops in our environment.  After adjustments were made, I was able to realize that we were dropping approximately 40% of our syslog data at the linux kernel. &lt;/P&gt;

&lt;P&gt;Increased the net.core.rmem _ max to 64MB.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;net.core.rmem_max = 67108864
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let syslog-ng know it has more input UDP buffer.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source s_network {
 udp(ip(0.0.0.0) port(514) so_rcvbuf(67108864));
};
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I wanted to update the ticket hopefully as a reference for anyone else that might experience this issue.  netstat -us showing UDP receive errors was a key tool in determining that we had an issue as well as benchmarking to determine the best buffer size.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2012 14:43:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90813#M18879</guid>
      <dc:creator>jodros</dc:creator>
      <dc:date>2012-03-15T14:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90814#M18880</link>
      <description>&lt;P&gt;Since this accepted answer, we have increased our syslog collection exponentially.  We again started to run up against massive UDP receive errors.  Tuning receive buffers did not resolve the issue this time.  Turns out that disabling use_dns() greatly improved performance.  We have not had an issue with it until about 4 months ago when we started rolling out Fortigate UTM's to all of our field offices.  With use_dns() disabled, we are back to "near zero" UDP receive errors&lt;/P&gt;

&lt;P&gt;Just wanted to provide an update.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:55:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90814#M18880</guid>
      <dc:creator>jodros</dc:creator>
      <dc:date>2020-09-28T17:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Log dropping in Syslog-ng</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90815#M18881</link>
      <description>&lt;P&gt;If running RHEL7:&lt;BR /&gt;
&lt;A href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html" target="_blank"&gt;https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/sect-Oracle_9i_and_10g_Tuning_Guide-Adjusting_Network_Settings-Changing_Network_Kernel_Settings.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;"   To make the change permanent, add the following lines to the /etc/sysctl.conf file, which is used during the boot process:&lt;BR /&gt;
    net.core.rmem_default=&lt;WHAT you="" want=""&gt;&lt;BR /&gt;
    net.core.wmem_default=&lt;WHAT you="" want=""&gt;&lt;BR /&gt;
    net.core.rmem_max=&lt;WHAT you="" want=""&gt;&lt;BR /&gt;
    net.core.wmem_max=&lt;WHAT you="" want=""&gt;"&lt;/WHAT&gt;&lt;/WHAT&gt;&lt;/WHAT&gt;&lt;/WHAT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:04:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-dropping-in-Syslog-ng/m-p/90815#M18881</guid>
      <dc:creator>kphillipson</dc:creator>
      <dc:date>2020-09-29T07:04:41Z</dc:date>
    </item>
  </channel>
</rss>

