Getting Data In

'Nice' a scripted input

Curt_Collins
Splunk Employee
Splunk Employee

Hi all,

Is there a way to "nice" a scripted input process so that it doesn't swamp the CPU? I have a scripted input on a LWF that is fairly CPU intensive if you just let it run. I'd like to "nice" it down to a level where it doesn't swamp the CPU.

The script doesn't need to run in a certain amount of time, so just nicing it down should be ok. I'm open to other approaches as well if people have solved this a different way. It would also be good to know how to do this on a Windows machine as well.

Thanks, Curt

1 Solution

gkanapathy
Splunk Employee
Splunk Employee

You could simply wrap your program inside a shell script that calls your program with "nice", and call that one as your scripted input instead:

#/bin/sh

nice -10 myprogram

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

You could simply wrap your program inside a shell script that calls your program with "nice", and call that one as your scripted input instead:

#/bin/sh

nice -10 myprogram

araitz
Splunk Employee
Splunk Employee

I would highly recommend throttling utilization within your script rather than relying on NICE, both for portability and for performance reasons. In other words, if your scripted input is causing a resource problem on your machine, then you are just band-aiding the process by using NICE.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...