Deployment Architecture

How to evict buckets from smartstore cache?

szymonledzinski
New Member

I'm testing Smartstore feature and I would like to test search performance when all buckets have to be downloaded from remote storage. To do this I would like to evict all the buckets from cache. Is there any command for this?

0 Karma

saravanan90
Contributor

Incase you want to delete a particular bucket and check how long it takes to download. Use the below.

curl -ku admin:changeme https://XX.XX.XX.XX:8089/services/admin/cacheman/$$bucketid$$/evict -X POST

To get the bucket id(| dbinspect index=indexname). This query result will shows the original path of the data present in splunk. Check the before and after evicting the buckets. Once it is evicted, run search which includes the search results available in the bucket. The buckets will be downloaded in the original path. Index=indexname component=cachemanager action=download bucketid shows it is downloaded.

0 Karma

dxu_splunk
Splunk Employee
Splunk Employee
curl -ku admin:changeme "https://localhost:8089/services/admin/cacheman/_evict" -d path=/path_to_cache/ -d mb=99999999999

you didn't ask for it, but the reverse is:

curl -ku admin:changeme "https://localhost:8089/services/admin/cacheman/_localize" -X POST
NOTE - triggering this endpoint will prevent normal evictions from occurring on the indexer afterwards until it restarts - thanks @tonguyen 

splunker686
Explorer

For the manual localize endpoint mentioned:

curl -ku admin:changeme "https://localhost:8089/services/admin/cacheman/_localize" -X POST

 Will it be localizing of all the buckets, of all the smartstore enabled indexes?  What are the specific endpoints for localizing an individual bucket or index?

0 Karma

anz_leycurav
Explorer

in real life, what does "/path_to_cache/" correspond to? is it the root of an index folder (ie the one containing "db" and "summary") or per bucket?

Thanks Vincent.

0 Karma

krishnasrinivas
Engager

Did you find out the answer for this?

0 Karma

Bselberg
Explorer

It's the volume name where the cache/hot buckets is located.

so if you have volume
/path/hotIndexVolume
/path/coldMountVolume/

Pass it /path/hotIndexVolume

0 Karma

tonguyen_splunk
Splunk Employee
Splunk Employee

Note: If you hit the _localize endpoint, you will not be able to evict any additional buckets until a restart occurs.

0 Karma

gjanders
SplunkTrust
SplunkTrust

@dxu excellent answer as always, do you know when cacheman will be added to the REST API reference manual? I cannot see it documented there...

0 Karma

dxu_splunk
Splunk Employee
Splunk Employee

there are some notes here https://docs.splunk.com/Documentation/Splunk/latest/Indexer/TroubleshootSmartStore#Troubleshoot_with... , not sure when these endpoints will be documented on the REST api

0 Karma

dxu_splunk
Splunk Employee
Splunk Employee

good call, we should doc it! i'll leave some feedback on the REST docs page (bottom of the page!)

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...