Splunk Search

How to improve django template search performance

vgnulinux
New Member

Created a django app to display some transaction history detail in a tabular format.
But when the template is accessed from the UI it takes almost 20-25 minutes for displaying search query result. Need help in improving performance of the search query and Django template.

Here is saved search code for reference.

[top_zip_by_amount]
alert.digest_mode = True
alert.suppress = 0
alert.track = 0
cron_schedule = 1 * * * * *
enableSched = 1
search = index=transaction_history |
spath input=Item |
rename HistoryItem.a:TransactionDetails.a:StoreId AS StoreNumber, HistoryItem.a:TotalAmount AS Amount |
fields StoreNumber,Amount |
lookup store_location StoreNumber as StoreNumber OUTPUT PostalCode |
table PostalCode StoreNumber Amount|
stats Sum(Amount) as Total1 count(StoreNumber) as TransactionCount by PostalCode StoreNumber|
fields PostalCode,StoreNumber,TransactionCount, Total1|
stats count(StoreNumber) as StoreCount sum(Total1) as TotalAmount by PostalCode|
fields PostalCode,StoreCount,TotalAmount|
sort TotalAmount desc

Anyone who can guide me on this ?

Thanks!

0 Karma

DavidHourani
Super Champion

Hello,

Are you sure it's the django causing the delays on the page ?

Can you try running your search in a non-django environment ?

Or maybe split the search into many small parts and start adding them up until you get to the part that makes it all slow down at least that way you would isolate your problem and eventually figure out whats causing all that delay.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

First you should check the job inspector for one of those searches to verify if it's the search job being slow or the django-based page rendering slowly.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Great. Any other issues left?

0 Karma

vkalgath
New Member

thanks martin, your advice to optimize search using search inspector did help us to improve performance of our web page in Django

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...