<?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: Is it possible to configure the memory allocation for a Splunk forwarder to prevent abrupt termination of the splunkd process? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116568#M24326</link>
    <description>&lt;P&gt;Thank you. &lt;BR /&gt;
I think my specific issue is that forwarder actually watching directory tree with 160,000+ files in it.&lt;BR /&gt;
Although 99% of these files are very rare being modified - not sure of that helps or not.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2015 00:25:40 GMT</pubDate>
    <dc:creator>gesman</dc:creator>
    <dc:date>2015-07-13T00:25:40Z</dc:date>
    <item>
      <title>Is it possible to configure the memory allocation for a Splunk forwarder to prevent abrupt termination of the splunkd process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116566#M24324</link>
      <description>&lt;P&gt;We have a situation where a Splunk forwarder is abruptly dying on one of the servers once a day or so.&lt;BR /&gt;
Upon further investigation this was discovered:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;root@intelsat [/var/log]# cat messages | grep splunkd
Jul 12 06:25:01 intelsat kernel: [30182]     0 30182   706988   480205   1       0             0 splunkd
Jul 12 06:25:01 intelsat kernel: [30183]     0 30183    13200       92   1     -17         -1000 splunkd
Jul 12 06:25:01 intelsat kernel: Out of memory: Kill process 30182 (splunkd) score 260 or sacrifice child
Jul 12 06:25:01 intelsat kernel: Killed process 30182 (splunkd) total-vm:2827952kB, anon-rss:1920820kB, file-rss:0kB
Jul 12 06:25:01 intelsat kernel: splunkd invoked oom-killer: gfp_mask=0x200da, order=0, oom_adj=0, oom_score_adj=0
Jul 12 06:25:01 intelsat kernel: splunkd cpuset=/ mems_allowed=0
Jul 12 06:25:01 intelsat kernel: Pid: 30201, comm: splunkd Not tainted 3.2.13-grsec-xxxx-grs-ipv6-64 #1
Jul 12 06:25:01 intelsat kernel: [30201]     0 30182   706988   480567   3       0             0 splunkd
Jul 12 06:25:01 intelsat kernel: [30183]     0 30183    13200       92   1     -17         -1000 splunkd
Jul 12 06:25:02 intelsat kernel: [30210]     0 30182   706988   480543   3       0             0 splunkd
Jul 12 06:25:02 intelsat kernel: [30183]     0 30183    13200       92   1     -17         -1000 splunkd
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As I understand, it's happening because Splunk forwarder requests more memory than available on the system?&lt;BR /&gt;
Is it possible to configure forwarder for some form of "safe" memory allocation strategy to prevent this from happening?&lt;/P&gt;

&lt;P&gt;Ideally i'd want to configure forwarder to auto-restart as well...&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jul 2015 20:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116566#M24324</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-07-12T20:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to configure the memory allocation for a Splunk forwarder to prevent abrupt termination of the splunkd process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116567#M24325</link>
      <description>&lt;P&gt;Hi gesman,&lt;/P&gt;

&lt;P&gt;Unfortunately, there is no direct way to limit the memory usage of a forwarder. &lt;BR /&gt;
But you can achieve it, if you make sure that your inputs are as limited as possible, e.g., point at single files or small directories with a few files and no subdirectories. You can reduce some memory by: shrinking maxQueueSize in outputs.conf to maybe 100 KB (vs a default of 500 KB)&lt;/P&gt;

&lt;P&gt;Another thing you can do, is to tell OOM of your OS to be "nicer" to Splunk, even they don't recommend turning it off.&lt;BR /&gt;
&lt;A href="http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html"&gt;http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regarding the &lt;CODE&gt;auto-restart&lt;/CODE&gt; feature; How should this be handled by Splunk if it is killed by OOM? Create a &lt;CODE&gt;agent-like&lt;/CODE&gt; wrapper script which checks if splunkd is running and if not, restart Splunk.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 00:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116567#M24325</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-13T00:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to configure the memory allocation for a Splunk forwarder to prevent abrupt termination of the splunkd process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116568#M24326</link>
      <description>&lt;P&gt;Thank you. &lt;BR /&gt;
I think my specific issue is that forwarder actually watching directory tree with 160,000+ files in it.&lt;BR /&gt;
Although 99% of these files are very rare being modified - not sure of that helps or not.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 00:25:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-configure-the-memory-allocation-for-a-Splunk/m-p/116568#M24326</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-07-13T00:25:40Z</dc:date>
    </item>
  </channel>
</rss>

