<?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: Lots of log files, how can I reduce forwarder memory usage? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94610#M19694</link>
    <description>&lt;P&gt;I have noticed a strange thing that I have described here:&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/32999/clean-the-crc-database"&gt;http://splunk-base.splunk.com/answers/32999/clean-the-crc-database&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2011 14:37:02 GMT</pubDate>
    <dc:creator>andyk</dc:creator>
    <dc:date>2011-10-26T14:37:02Z</dc:date>
    <item>
      <title>Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94602#M19686</link>
      <description>&lt;P&gt;The forwarder is using 4.3 GB memory. I think that is insane.&lt;BR /&gt;
OS: Windows 2008 R2&lt;BR /&gt;
Splunk 4.2.3&lt;/P&gt;

&lt;P&gt;The folder I am monitoring contains 11156 files in 699 folders. The total amount of log file data is 7.5 GB.&lt;/P&gt;

&lt;P&gt;The forwarder is configured as a "full forwarder" since I need to send data to 2 different indexers.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://E:\Data\pnlog]
host = 10.41.10.13
index = main
whitelist = \.log$
disabled = 0
followTail = 1
_TCP_ROUTING = pnlogGroup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;// Andreas&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2011 13:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94602#M19686</guid>
      <dc:creator>andyk</dc:creator>
      <dc:date>2011-10-19T13:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94603#M19687</link>
      <description>&lt;P&gt;One of the first things I would suggest is to use &lt;CODE&gt;ignoreOlderThan&lt;/CODE&gt; in inputs.conf in order to keep splunkd from iterating through files with a modification time that has fallen behind a certain time window :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ignoreOlderThan = &amp;lt;time window&amp;gt;
  * Causes the monitored input to stop checking files for updates if their modtime has passed this threshold.
  This improves the speed of file tracking operations when monitoring directory hierarchies with large numbers of historical files (for example, when active log files are colocated with old files that are no longer being written to).
  * As a result, do not select a cutoff that could ever occur for a file you wish to index.
  Take downtime into account!  
  Suggested value: 14d , which means 2 weeks
  * A file whose modtime falls outside this time window when seen for the first time will not be indexed at all.
  * Value must be: &amp;lt;number&amp;gt;&amp;lt;unit&amp;gt; (e.g., 7d is one week).  Valid units are d (days), m (minutes), and s (seconds).
  * Default: disabled.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Beyond that, you would need to use external means to further restrict the number of files that are exposed to splunkd so that it doesn't have to create and maintain a large number of objects in memory. Note that using a &lt;CODE&gt;whitelist&lt;/CODE&gt; or &lt;CODE&gt;blacklist&lt;/CODE&gt; in inputs.conf to exclude some files from indexing still exposes them to splunkd for evaluation, which contributes to its resource consumption.&lt;/P&gt;

&lt;P&gt;If your directory structure and log file distribution allows it, try to define one file monitor stanza per directory that contains logs to follow (up to 50 or so is reasonable) and use &lt;CODE&gt;recursive = false&lt;/CODE&gt; in inputs.conf to scope the tailing processor to those directories only.&lt;/P&gt;

&lt;P&gt;This advice is of course irrelevant if you actually have live logs you want to index in &lt;STRONG&gt;all&lt;/STRONG&gt; 699 directories.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;UPDATE : ** After discussing this with one of our developers, it turns out that &lt;CODE&gt;ignoreOlderThan&lt;/CODE&gt; doesn't prevent us from creating an in-memory object for every file the tailing processor sees on splunkd startup, it just sets some aside never to be queried from disk ever again. As a result, &lt;CODE&gt;ignoreOlderThan&lt;/CODE&gt; will have a positive effect on splunkd CPU usage but most likely **not&lt;/STRONG&gt; on memory usage.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 00:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94603#M19687</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2011-10-20T00:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94604#M19688</link>
      <description>&lt;P&gt;Thank you for this very valuable information. I will try to implement your solutions right now! To bad Splunk support couldn't give me this information when I contacted them...&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 08:14:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94604#M19688</guid>
      <dc:creator>andyk</dc:creator>
      <dc:date>2011-10-20T08:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94605#M19689</link>
      <description>&lt;P&gt;I added ignoreOlderThan = 3d and restarted the forwarder.&lt;BR /&gt;
Saddly, it didn't help at all. The forwarder is now right back at 4.3 GB mem usage. I did a search and there is only 813 files in 73 directory's that are younger than 3 days.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:36:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94605#M19689</guid>
      <dc:creator>andyk</dc:creator>
      <dc:date>2011-10-20T14:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94606#M19690</link>
      <description>&lt;P&gt;That's disappointing. Do you know if the CPU usage of splunkd has gone down since you introduced ignoreOlderThan? Also, are there other inputs defined on this forwarder that could be responsible for the memory usage?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 16:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94606#M19690</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2011-10-20T16:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94607#M19691</link>
      <description>&lt;P&gt;The cpu usage is about the same. It has to be this input that causes the high mem usage. It is the only input that differs from other forwarders that have normal mem usage, 200-300MB.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2011 08:47:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94607#M19691</guid>
      <dc:creator>andyk</dc:creator>
      <dc:date>2011-10-21T08:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94608#M19692</link>
      <description>&lt;P&gt;I have no experience of your situation, but just wanted to mention that the latest Splunk release (4.2.4) addresses an issue with very high memory usage:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Faulty TCP connection causes very high memory usage on the Windows universal forwarder. (SPL-42854) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've no idea whether this fixes your issue or not, but it might be worth a try.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2011 08:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94608#M19692</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-10-21T08:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94609#M19693</link>
      <description>&lt;P&gt;I believe that SPL-42854 would only be relevant if the queues on the forwarder are full. Also, it can only account for up to 400MB or so of excess memory usage.&lt;BR /&gt;&lt;BR /&gt;
@andyk : there's an important question I forgot to ask : What metric are you looking at when you report that 4.3Gb memory usage figure? Is this RSS/working set size or virtual size?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2011 18:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94609#M19693</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2011-10-21T18:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94610#M19694</link>
      <description>&lt;P&gt;I have noticed a strange thing that I have described here:&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/32999/clean-the-crc-database"&gt;http://splunk-base.splunk.com/answers/32999/clean-the-crc-database&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 14:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94610#M19694</guid>
      <dc:creator>andyk</dc:creator>
      <dc:date>2011-10-26T14:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lots of log files, how can I reduce forwarder memory usage?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94611#M19695</link>
      <description>&lt;P&gt;It might be over 8 years later and we're now on splunk 7.2 but we've just had a big issue with splunkd process consuming a lot of memory (1GB).  Just want to let people know that setting an ignoreOlderThan config DID have a huge impact in reducing memory (reduced it to a quarter of what it was).&lt;/P&gt;

&lt;P&gt;In our case Splunk was monitoring a directory that had over 200k files in. A cleanup job was the answer but before that could be implemented, we set ignoreOlderThan = 2d to bring the server memory down from a critical level. CPU also came down.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 12:26:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lots-of-log-files-how-can-I-reduce-forwarder-memory-usage/m-p/94611#M19695</guid>
      <dc:creator>rickybails</dc:creator>
      <dc:date>2019-11-19T12:26:04Z</dc:date>
    </item>
  </channel>
</rss>

