<?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: How does Splunk check for ulimit in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293281#M5202</link>
    <description>&lt;P&gt;Have you checked which user is running Splunk in site 1 instances?&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jun 2017 19:02:59 GMT</pubDate>
    <dc:creator>diogofgm</dc:creator>
    <dc:date>2017-06-30T19:02:59Z</dc:date>
    <item>
      <title>How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293280#M5201</link>
      <description>&lt;P&gt;Hopefully somebody can point us to a right direction:&lt;/P&gt;

&lt;P&gt;We have multisite indexer cluster: two sites, 4 indexers per site (Splunk v. 6.5.3)&lt;BR /&gt;
Few months ago, following Splunk's recommendations, we increased ulimit -n to a higher value 16384 on all indexers&lt;BR /&gt;
for root and splunk user.&lt;BR /&gt;
To make these changes persistent across reboots our Unix SAs added this to the bottom of /etc/security/limits.conf file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunkuser soft nofile 16384
splunkuser  hard nofile 16384
root soft nofile 16384
root hard nofile 16384
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Running "ulimit -n" directly on all 8 servers returns an expected value: &lt;CODE&gt;16384&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;Still when we run health check via Splunk Monitoring Console , it finds that all 4 servers on Site 1 have  ulimits.open_files set to 4096 while ulimits.open_files set to 16384 on all servers on Site 2 .&lt;/P&gt;

&lt;P&gt;How does Splunk check for ulimit and what might be a cause for this discrepancy?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293280#M5201</guid>
      <dc:creator>mlevsh</dc:creator>
      <dc:date>2020-09-29T14:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293281#M5202</link>
      <description>&lt;P&gt;Have you checked which user is running Splunk in site 1 instances?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293281#M5202</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2017-06-30T19:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293282#M5203</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;This is indeed an annoying issue we have with recent Linux distributions using systemd, and that I hope to see fixed by Splunk someday.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;To have Splunk using good ulimits when restarted as a service, you have a few simple options:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;You can:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Modify /etc/init.d/splunk script on your servers, and replace within the start function the existing with:&lt;/P&gt;

&lt;P&gt;su - splunk -c "/opt/bin/splunk start --no-prompt --answer-yes"&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Which will start splunk with the same environment conditions than using CLI.&lt;/P&gt;

&lt;P&gt;Notes: You need to adapt the user name if different, and the path to Splunk as well if not using default.&lt;/P&gt;

&lt;P&gt;After the modification, you usually need to run:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;systemctl daemon-reload
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;If your system is systemd compatible, then you can as well create a filelimit.conf service file:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;/etc/systemd/system/splunk.service.d/filelimit.conf (adapt your values to whatever you want to set)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      [Service]
      LimitNOFILE=20240
      LimitNPROC=100000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And run:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;systemctl daemon-reload
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first option is basically re-doing what Splunk was doing with enable boot-start option with old versions of Splunk.&lt;BR /&gt;
In recent Splunk, a start as a service runs as root and Splunk itself spawns the processes under the good username defined in $SPLUNK_HOME/etc/splunk-launch.conf&lt;/P&gt;

&lt;P&gt;The second option is perfectly fine as well if you have an OS using systemd.&lt;/P&gt;

&lt;P&gt;I had an other example recently of similar issue with a customer using the pamd-tmp module in Ubuntu, and the first option has been required to fix Splunk from having in heritage the $TMP value from root. But that is another story.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Guilhem&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293282#M5203</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2017-06-30T19:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293283#M5204</link>
      <description>&lt;P&gt;Have a look at this post, you will see as well a variant solution of the first option. (init.d modification)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/223838/why-are-my-ulimits-settings-not-being-respected-on.html"&gt;https://answers.splunk.com/answers/223838/why-are-my-ulimits-settings-not-being-respected-on.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Once you have made your system modification, restart Splunk as a service and ensure by looking at splunkd.log that you the values you have set.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:13:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293283#M5204</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2017-06-30T19:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293284#M5205</link>
      <description>&lt;P&gt;@diogofgm,  it's the same user that is running Splunk on both sites&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293284#M5205</guid>
      <dc:creator>mlevsh</dc:creator>
      <dc:date>2017-06-30T19:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293285#M5206</link>
      <description>&lt;P&gt;@guilmxm , I'm so grateful for your detailed answer! Thank you. &lt;BR /&gt;
 I will  have to contact our Unix SAs to see if our Linux distribution is systemd compatible before we select the right option for us.  I will update my post with results.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 20:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293285#M5206</guid>
      <dc:creator>mlevsh</dc:creator>
      <dc:date>2017-06-30T20:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293286#M5207</link>
      <description>&lt;P&gt;@guilmxm , just one more question. Do you have any ideas, why servers on one site recognize good ulimits and all servers on other site - not?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jul 2017 22:39:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293286#M5207</guid>
      <dc:creator>mlevsh</dc:creator>
      <dc:date>2017-07-01T22:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293287#M5208</link>
      <description>&lt;P&gt;@mlevsh&lt;/P&gt;

&lt;P&gt;Well, when you start Splunk from a terminal under the Unix service account, splunkd process will have the proper ulimits you have set and can observe running "ulimits -a" in terminal.&lt;BR /&gt;
Once started in CLI, a rolling restart for instance will keep as well the same ulimits.&lt;BR /&gt;
The issue appears when Splunk is restarted as a system service at boot time or using init.d or service command.&lt;BR /&gt;
So the sites might not have been started. (or restarted) the same way&lt;/P&gt;

&lt;P&gt;Other options could be that this site has not the same init.d version (older version from previous Splunk release), or does not run the same Operating system version, or for some other reason is not exactly configured the same way and not affected.&lt;/P&gt;

&lt;P&gt;To be sure of your settings on both sites, restart an instance in terminal and check splunkd logs (grep ulimit /opt/splunk/var/log/splunkd.log in terminal or search in index=_internal sourcetype=splunkd ulimit), after that restart the instance as root and as a service (service splunk restart) and again verify the ulimit in logs.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jul 2017 01:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293287#M5208</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2017-07-02T01:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: How does Splunk check for ulimit</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293288#M5209</link>
      <description>&lt;P&gt;@guilmxm, thank you so much for this detailed explanation!&lt;BR /&gt;
We haven't made changes ,you suggested in original answer, yet as it is a production system and it takes time to test and later go through normal process of modifying production servers.&lt;/P&gt;

&lt;P&gt;One thing I wanted to bring up:&lt;BR /&gt;&lt;BR /&gt;
As you wrote and I've noticed myself as well, that if splunk process is running as "splunkd -p 8089 &lt;STRONG&gt;start&lt;/STRONG&gt;" then we observe ulimit discrepancy.&lt;BR /&gt;
But if its' running as "splunkd -p 8089 &lt;STRONG&gt;restart&lt;/STRONG&gt;" then there is  no discrepancy. &lt;/P&gt;

&lt;P&gt;But majority of our Splunk servers are running as "splunk -p 8089 start" because it starts via enable-bootstart without user session.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 20:17:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-does-Splunk-check-for-ulimit/m-p/293288#M5209</guid>
      <dc:creator>mlevsh</dc:creator>
      <dc:date>2017-07-07T20:17:55Z</dc:date>
    </item>
  </channel>
</rss>

