Splunk Search and Performance Improvements
Splunk Search and Performance Improvements
Improvements
What we’ve done and why we did it…
The forward-looking statements made in this presentation are being made as of the time and date of its live
presentation. If reviewed after its live presentation, this presentation may not contain current or accurate
information. We do not assume any obligation to update any forward looking statements we may make. In
addition, any information about our roadmap outlines our general product direction and is subject to change
at any time without notice. It is for informational purposes only and shall not be incorporated into any contract
or other commitment. Splunk undertakes no obligation either to develop the features or functionality
described or to include any such feature or functionality in a future release.
Splunk, Splunk>, Listen to Your Data, The Engine for Machine Data, Splunk Cloud, Splunk Light and SPL are trademarks and registered trademarks of Splunk Inc. in
the United States and other countries. All other brand names, product names, or trademarks belong to their respective owners. © 2017 Splunk Inc. All rights reserved.
Session Outline
Language Improvements
Data Model Improvements
Optimizer Improvements
Further Improvement Ideas
Q&A
3
SPL Language
Improvements
Generating Search – typical breakdown
i.e. the time taken for the first search processor to do its job, with lots of TAs.
index scan
rawdata & decompression
kv
(auto and explicit)
autolookup
post filter search
typer
~ 50%
tagger
time
5
Search Directives
Producing TAGS & EVENT TYPES is very costly
• With lots of TAs it can easily be 50% of the total cost of the search
• Tags are stored in one multi-valued field
• We treat as ALL or NOTHING
Now have a way to selectively request just one or more TAGS (and types)
• search 500 DIRECTIVES(REQUIRED_TAGS(tags="foo, bar"))
• search 500 DIRECTIVES(REQUIRED_EVENTTYPES(eventtypes="alpha,omega"))
Combining Directives…
• search 500 DIRECTIVES(REQUIRED_EVENTTYPES(eventtypes="alpha,omega"),REQUIRED_TAGS(tags="foo,bar"))
• Will produce list of EVENT TYPES needed to correctly produce foo and bar tags
• And merge with “alpha, omega” event types...
Impact
• Low – targeted searches for a few events
• High – broad searches returning lots of events (i.e. Monitoring & Acceleration)
How Data Model Acceleration works…
25
20
15
TIME
10
5
0
INDEXERS
7
Data Model Acceleration (DMA)
Problem and Solution
▶ Issues prior to 7.0:
• Acceleration of warm/cold buckets was all or nothing. (I’ve started so I’ll finish...)
• So acceleration of a large warm/cold bucket could monopolize acceleration.
• Slowest indexer holds up the other indexers.
• So even temporary data imbalance could lead to loss of parallelism, and cascading delays.
▶ Solution:
• Added ability to pause / continue accelerating warm/cold buckets. (I’ve started, but something more important / hot has come along…)
• This means acceleration.max_time is now fully respected, even when processing historical data.
• Next acceleration search starts with hot buckets, thus keeping lag low, even when rebuilding acceleration from scratch.
• If summarization search finishes early we can poll for new data (to reduce lag) so all indexers can be keep busy.
• See new setting acceleration.poll_buckets_until_maxtime=true
▶ Impact:
• 7.0 typically twice as fast as 6.5 (or faster).
• 7.0 lag typically 50% as 6.5 (or less).
• Data Model Acceleration Rebuilds have less impact.
Demo #1
Typer / Tagger and DMA improvements
Improved High Cardinality Processing
Using Parallel Reduce
▶ Imagine a search like this:
• search tag=authentication | stats sum(bytes) by host
Predicate Splitting
– | eval x = a+b | where x=10 and y=10
– | where y=10 | eval x = a+b | where x=10
Tag Elimination
– search ERROR | where tag=“Authentication” | stats count by host
– search DIRECTIVES(REQUIRED_TAGS(tags=“Authentication”)) | where tag=Authentication | stats count by host
Predicate Normalization
– search ERROR | where 10=y
– search ERROR y=10
– Why would you ever do this:
ê search ERROR |… |… | eval x=10|… |… | where x=y
12
Further Improvement
Ideas
Further Improvement Ideas (1)
• Etc.
Further Improvement Ideas (2)
…
Run 10
… 10 11 12
Run 11
Run 12
▶ Report Acceleration (RA) has the ability to incrementally build results already.
• Unfortunately RA doesn’t work for TSTATS searches.
• Why? TSTATS searches leverage Data Model Acceleration (DMA) and we don’t support RA over DMA.
▶ Many Sliding Windows searches are based on TSTATS
• Currently investigating adding support for RA over DMA
Summary - What does this mean for you?
Faster Searches
Faster Enterprise Security
Look for opportunities to use new DIRECTIVES
Checkout the optimizer in the Job Inspector
Upgrade to 7.0 (or at least 6.5 if that isn’t possible).
17
Q&A
Alex James - Senior Principal Product Manager
Manan Brahmkshatriya – Principal QA Engineer
© 2017 SPLUNK INC.
Thank You
Don't forget to rate this session in the
.conf2017 mobile app
Backup Slides
If the session runs short…
Union
• <except> it runs in parallel on indexers (using an improved version of multisearch when possible)
Useful for correlation searches, i.e. append | stats to do a pseudo join
Supports:
• More than 2 datasets: | union [<spl1>], [<spl2>], ... , [<splN>]
• Named dataset format (like from) : | union savedsearch:mysavedsearch, [<spl2>], inputlookup:threats
• Shorthand (like append): <spl1> | union [<spl2>]
25
13 mins
20
DELAY
15
TIME
10 7 mins
5
5 mins
0
INDEXERS