<?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 How to Calculate total Search Load for  my Search Head Clustering Deployment? in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270858#M10316</link>
    <description>&lt;P&gt;Can you please help us in letting know calculation on how our search concurrency limit is being hit  in my Search Head Cluster Deployment?  We will like to investigate when we see a Schedules search being skipped.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Sep 2016 23:16:36 GMT</pubDate>
    <dc:creator>sat94541</dc:creator>
    <dc:date>2016-09-08T23:16:36Z</dc:date>
    <item>
      <title>How to Calculate total Search Load for  my Search Head Clustering Deployment?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270858#M10316</link>
      <description>&lt;P&gt;Can you please help us in letting know calculation on how our search concurrency limit is being hit  in my Search Head Cluster Deployment?  We will like to investigate when we see a Schedules search being skipped.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 23:16:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270858#M10316</guid>
      <dc:creator>sat94541</dc:creator>
      <dc:date>2016-09-08T23:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate total Search Load for  my Search Head Clustering Deployment?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270859#M10317</link>
      <description>&lt;P&gt;Response to your question is not very simple. At high level splunk run following type of searches&lt;/P&gt;

&lt;P&gt;@adhoc searches&lt;BR /&gt;&lt;BR /&gt;
@Scheduled Searches  ( running and delegated )&lt;BR /&gt;
@Report Acceleration (running and delegate) &lt;BR /&gt;
@datamodel acceleration (running and delegated) &lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/157234-table.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;To calculate number of SHC wide concurrent searches running at any given time it is required to calculate at adhoc searches+ scheduled searches + Report Acceleration scheduled searches + datamodel acceleration scheduled searches +delegrated searches . &lt;BR /&gt;
  Here are various log and searches that can be leveraged  to get some stats, but these searches won’t provide you complete data. Splunk currently has an open Enhancement Request (SPL-125101:Comprehensive search concurrency metrics) to streamline these stats for reporting needs.)&lt;/P&gt;

&lt;P&gt;1)  The  introspection log provide snapshot of all searches running on the SHC members. This snapshot is taken every 10sec for scheduled searches + Report Acceleration+ datamodel acceleration. You can use the search below to get trend of the searches being run in each category.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal  ( host=&amp;lt;&amp;gt; ….) 
            sourcetype=splunk_resource_usage component=PerProcess data.search_props.sid=*
                      | eval data.search_props.type = if(like('data.search_props.sid',"%_scheduler_%"),"scheduled",'data.search_props.type')
                      | bin _time span=10s
                      | stats dc(data.search_props.sid) AS distinct_search_count by _time,data.search_props.type 
                      | timechart bins=200 max(distinct_search_count) AS "median of search concurrency" by data.search_props.type| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/157235-image.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Stats form  introspection Data has following challenges :&lt;BR /&gt;
@@Introspection Data is sampled every 10sec which means the searches that finished during 10s won’t get accounted. &lt;BR /&gt;
@@ Introspection Data also doesn’t account for delegated searches &lt;/P&gt;

&lt;P&gt;Due to these challenged introspection date can only be used to see the trend and may show stats below the actual search load. &lt;/P&gt;

&lt;P&gt;2)  To get the delegated searches  I have been researching it in last few days and development has provided useful tips as published in  &lt;A href="https://answers.splunk.com/answers/449024/search-head-cluster-scheduled-searches-and-status.html" target="_blank"&gt;https://answers.splunk.com/answers/449024/search-head-cluster-scheduled-searches-and-status.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Based on this the scheduler/captain calculates the total number of scheduled searches can be derived from metrics (group=searchscheduler)  as  activeScheduledSearches.size + activeDelegatedSearch.size and  below is the sample searches  - but this metrics is missing adhoc  searches.&lt;BR /&gt;
Another limitation with this search is that it’s sampled(snapshotted ) every 30 sec.  So even this data will miss the searches that finished in between those 30 sec&lt;/P&gt;

&lt;P&gt;Scheduler Activity (based on metrics.log) :&lt;/P&gt;

&lt;P&gt;index=_internal  sourcetype=splunkd  source=&lt;EM&gt;metrics&lt;/EM&gt; group=searchscheduler | timechart span=3m sum(dispatched) as dispatched, sum(skipped) as skipped, sum(delegated) as delegated Max(delegated_waiting) as delegated_waiting, sum(delegated_scheduled) as delegated_scheduled, Max(max_pending) as max_pending, Max(max_running) as max_running&lt;/P&gt;

&lt;P&gt;3)Here is another search that can be used to get  scheduled ( running + skipped) from scheduler.log  along with adhoc from _audit. To get meaning full data you need to run it for long time period like 4 hours or above.  This is also missing delegated search. Another challenge is with audit log as it’s  not always complete for ad-hoc searches. So number may be bit skewed. &lt;/P&gt;

&lt;P&gt;Skipped searches vs concurrency:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=&amp;lt;SHC_HOST_NAME&amp;gt;
(index=_internal source=*/scheduler.log*  (status=success run_time=*) OR status=skipped) OR
(index=_internal source=*/scheduler.log*  (status=success run_time=*) OR status=skipped) OR
((index=_audit action=search info=completed) (NOT search_id='scheduler_*' NOT search_id='rsa_*'))

| eval type=if(status="skipped", "skipped", "completed")
| eval run_time=coalesce(run_time, total_run_time)
| eval counter=-1
| appendpipe [
    | eval counter=1
    | eval _time=_time - run_time
]

| sort 0 _time
| streamstats sum(counter) as concurrency by type
| table _time concurrency counter run_time type
| timechart partial=f sep=_ span=1m count min(concurrency) as tmin max(concurrency) as tmax by type
| rename count_skipped as skipped     tmin_completed as min_concurrency     tmax_completed as max_concurrency
| fields + _time skipped *_concurrency
| filldown *_concurrency
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Delayed-minutes vs concurrency:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=&amp;lt;SHC_HOST_NAME&amp;gt;
index= _audit
(action=search info=completed)
(NOT search_id='scheduler_*' NOT search_id='rsa_*')

| eval run_time=coalesce(run_time, total_run_time)
| eval counter=-1
| appendpipe [
    | eval counter=1
    | eval _time=_time - run_time
]

| sort 0 _time
| streamstats sum(counter) as concurrency
| timechart partial=f sep=_ span=1m min(concurrency) as min_concurrency max(concurrency) as max_concurrency
| filldown *_concurrency

| join _time [
    | search index=internal host=&amp;lt;SHC_HOST_NAME&amp;gt;  source=*/scheduler.log* (status=success OR status=continued OR status=skipped)
    | eval dispatch_time =  coalesce(dispatch_time, _time)
    | eval scheduled_time = if(scheduled_time &amp;gt; 0, scheduled_time, "WTF")
    | eval window_time =    coalesce(window_time, "0")
    | eval execution_latency = max(dispatch_time - (scheduled_time + window_time), 0)
    | timechart partial=f sep=_ span=1m sum(execution_latency) as delayed_seconds
    | eval delayed_minutes=coalesce(delayed_seconds/60, 0)
    | fields + _time delayed_minutes
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Due to these limitation currently  splunk provide some challenges when you are trying to find Comprehensive search concurrency metrics .&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270859#M10317</guid>
      <dc:creator>rbal_splunk</dc:creator>
      <dc:date>2020-09-29T10:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate total Search Load for  my Search Head Clustering Deployment?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270860#M10318</link>
      <description>&lt;P&gt;Also look at &lt;A href="https://confluence.splunk.com/display/%7Emjose/Scheduler+activity+Debugging+in+SHC"&gt;https://confluence.splunk.com/display/~mjose/Scheduler+activity+Debugging+in+SHC&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 23:32:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270860#M10318</guid>
      <dc:creator>rbal_splunk</dc:creator>
      <dc:date>2016-09-08T23:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Calculate total Search Load for  my Search Head Clustering Deployment?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270861#M10319</link>
      <description>&lt;P&gt;Link is broken&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 22:05:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/How-to-Calculate-total-Search-Load-for-my-Search-Head-Clustering/m-p/270861#M10319</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2018-01-16T22:05:33Z</dc:date>
    </item>
  </channel>
</rss>

