Monitoring Splunk

How can I generate a search which uses lots of memory?

danielbb
Motivator

We are about to enable the enable_memory_tracker feature.

We'll use -

enable_memory_tracker = true 
search_process_memory_usage_percentage_threshold = 13
search_process_memory_usage_threshold = 4000

In order to test it, how can I generate searches that consume gigabytes of memory?

Labels (1)
Tags (1)
0 Karma

codebuilder
Influencer

Use EventGen (https://splunkbase.splunk.com/app/1924/) to generate thousands or millions of random events containing dozens or hundreds of fields, and spanning several years.

Send those events to the index of your choice.

Then run a verbose, all-time search using:

index=your_index_name_here |table *

A similar approach which doesn't require EventGen would be to take a sample file such as /var/log/messages, and use a bash script or simple for loop to copy it a gazillion times to some directory, while changing the file name each time, and ingest all those using a forwarder to populate your index. Then run the same search as described.

Either should work. I'm sure there are other solutions as well, but those two options come to mind first...

----
An upvote would be appreciated and Accept Solution if it helps!

danielbb
Motivator

The query (index=* OR index=_*) | table * did it and it produced the message in the UI, saying -

-- The search processs with sid=1590066363.14344 was forcefully terminated because its physical memory usage (6456.715000 MB) has exceeded the 'search_process_memory_usage_threshold' (4000.000000 MB) setting in limits.conf.

Where do we enable the MC admin message for this case, when it happens?

0 Karma

codebuilder
Influencer

Glad to hear that worked for you 😄 !

There's a canned DMC alert for this you can enable named "DMC Alert - Critical System Physical Memory Usage".

Or, you can create your own, obviously.

If you feel like this reply solved your issue please consider accepting the answer, so others can benefit as well.

----
An upvote would be appreciated and Accept Solution if it helps!

danielbb
Motivator

Right @codebuilder, but it's a generic message. It seems that the index=_internal sourcetype=splunkd component=SearchProcessMemoryTracker event_message="*Forcefully terminated*" brings data about these cases.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...