<?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: Troubleshooting high Search Head CPU in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68701#M787</link>
    <description>&lt;P&gt;Other tools you use to this effect include:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;The &lt;A href="http://www.splunk.com/goto/sos"&gt;S.o.S app&lt;/A&gt; can help you to track CPU usage at a per-process level for Splunk processes with the 'ps_sos.sh' scripted input. For more information, read &lt;A href="http://splunk-base.splunk.com/answers/38832/how-do-i-set-up-the-sos-app-to-monitor-splunks-system-resource-consumption"&gt;this Splunk Answer&lt;/A&gt;.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The 'top' command scoped on the main splunkd process and split by thread.&lt;BR /&gt;
top -H -p &lt;CODE&gt;head -1 $SPLUNK_HOME/var/run/splunk/splunkd.pid&lt;/CODE&gt;&lt;BR /&gt;
If the CPU usage is associated with the main splunkd process, this would allow you to identify the thread ID that is mainly responsible for it. Using 'pstack', you might even be able to take a good guess at which component that is. The Tailing Processor thread is usually easy to identify, for example.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 20 Mar 2013 20:42:33 GMT</pubDate>
    <dc:creator>hexx</dc:creator>
    <dc:date>2013-03-20T20:42:33Z</dc:date>
    <item>
      <title>Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68698#M784</link>
      <description>&lt;P&gt;Hi.  I have been struggling with getting to the root of some performance problems on our pool of search heads...which are two beefy servers.  We do NOT see this performance issue on our other, identical site.  The only difference is the users of the site and any searches they may run.&lt;/P&gt;

&lt;P&gt;When I try a splunk restart, splunkweb always hangs and the python process ultimately has to be killed manually.&lt;/P&gt;

&lt;P&gt;I have started using SoS to try to help figure this out.&lt;/P&gt;

&lt;P&gt;It shows occasional Splunkweb CPU spikes but nothing that lasts and explains the persistent slowness of our system.  However, "top" shows Splunkd as the culprit, so I'm unsure where to go from there.&lt;/P&gt;

&lt;P&gt;Can anyone suggest how I might start narrowing this problem down?&lt;/P&gt;

&lt;P&gt;I have already disabled any glaringly obvious user searches that would hose the system.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 18:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68698#M784</guid>
      <dc:creator>Sqig</dc:creator>
      <dc:date>2013-03-20T18:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68699#M785</link>
      <description>&lt;P&gt;I don't have any answer off the top of my head, so I'll just comment here: I once saw a system brought to its knees by a populating search for a summary index - it looked innocent enough, but the person who wrote it was unclear on the concept...&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 18:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68699#M785</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-20T18:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68700#M786</link>
      <description>&lt;P&gt;Check the number of threads your splunkd process is using by doing:&lt;/P&gt;

&lt;P&gt;ps -Lef | grep $splunkpid | wc -l&lt;/P&gt;

&lt;P&gt;then try:&lt;/P&gt;

&lt;P&gt;pstack $splunkpid &amp;gt; $outputfilename&lt;/P&gt;

&lt;P&gt;See if any of that gets you on the right path.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2013 19:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68700#M786</guid>
      <dc:creator>jtrucks</dc:creator>
      <dc:date>2013-03-20T19:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68701#M787</link>
      <description>&lt;P&gt;Other tools you use to this effect include:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;The &lt;A href="http://www.splunk.com/goto/sos"&gt;S.o.S app&lt;/A&gt; can help you to track CPU usage at a per-process level for Splunk processes with the 'ps_sos.sh' scripted input. For more information, read &lt;A href="http://splunk-base.splunk.com/answers/38832/how-do-i-set-up-the-sos-app-to-monitor-splunks-system-resource-consumption"&gt;this Splunk Answer&lt;/A&gt;.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;The 'top' command scoped on the main splunkd process and split by thread.&lt;BR /&gt;
top -H -p &lt;CODE&gt;head -1 $SPLUNK_HOME/var/run/splunk/splunkd.pid&lt;/CODE&gt;&lt;BR /&gt;
If the CPU usage is associated with the main splunkd process, this would allow you to identify the thread ID that is mainly responsible for it. Using 'pstack', you might even be able to take a good guess at which component that is. The Tailing Processor thread is usually easy to identify, for example.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 20 Mar 2013 20:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68701#M787</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2013-03-20T20:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68702#M788</link>
      <description>&lt;P&gt;I would also check your dispatch directory. A large amount of dirs/files can slow things down.&lt;BR /&gt;
$SPLUNK_HOME/var/run/splunk/dispatch&lt;BR /&gt;
or if in a pooled space&lt;BR /&gt;
[Pooled Share]/var/run/splunk/dispatch&lt;/P&gt;

&lt;P&gt;to get a count of files/dirs in each directory&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ls -l|wc -l
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might want to check for a large amount of files under the var dirs in general.&lt;/P&gt;

&lt;P&gt;Here's also a search to calculate scheduled search lag to see if the scheduler is lagging. 30 seconds lag is probably normal but you may want to investigate above that. you can set the HIGH_WATERMARK to your liking as a reference point.&lt;/P&gt;

&lt;P&gt;As a requirement, you will need to be indexing the scheduler.log&lt;/P&gt;

&lt;P&gt;replace host names below with host names for your search heads&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(host=hosta OR host=hostb) index=_internal source=*scheduler.log |eval JOB_DELAY_SECS=(dispatch_time-scheduled_time)|timechart span=5m perc95(JOB_DELAY_SECS) by host|eval HIGH_WATERMARK=100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you are on Linux, you can run this command to see what splunkd or splunkweb is spending time on.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;strace -p &amp;lt;splunk pid&amp;gt; -tt
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2013 04:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68702#M788</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2013-03-21T04:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68703#M789</link>
      <description>&lt;P&gt;This turned out to be where the problem was.  There were session and session.lock files going back for over a year -- roughly 2 million.  Caused by over-monitoring of the systems and an apparent bug (from what I read) in this older version of Splunk in cleaning up the files.  Newer versions have this fixed.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2013 17:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/68703#M789</guid>
      <dc:creator>Sqig</dc:creator>
      <dc:date>2013-06-26T17:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: Troubleshooting high Search Head CPU</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/709794#M10689</link>
      <description>&lt;P&gt;I've facing this issue also, and currently it solved.&lt;/P&gt;&lt;P&gt;First, need to see what actually is running, go to the console monitoring in the master.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="muhammad_luthfi_3-1737891918063.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34249iA2FBB75D51FC0F39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="muhammad_luthfi_3-1737891918063.png" alt="muhammad_luthfi_3-1737891918063.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;run bellow to find the search query/name.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/search/jobs 
| search isRealTimeSearch=1 
| table sid, dispatchState, runDuration, search, eventCount, resultCount, title, provenance, label&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And i found the what is search indicated high CPU&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="muhammad_luthfi_1-1737891774871.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34247i7DA274054BDFA9AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="muhammad_luthfi_1-1737891774871.png" alt="muhammad_luthfi_1-1737891774871.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Go to the job console in the top right side, and stop or delete the job.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="muhammad_luthfi_2-1737891803659.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/34248iF883C187ADD516A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="muhammad_luthfi_2-1737891803659.png" alt="muhammad_luthfi_2-1737891803659.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully will be help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 11:46:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/Troubleshooting-high-Search-Head-CPU/m-p/709794#M10689</guid>
      <dc:creator>muhammad_luthfi</dc:creator>
      <dc:date>2025-01-26T11:46:09Z</dc:date>
    </item>
  </channel>
</rss>

