Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search Perf] Improve throughput of backendRequests #2469

Closed
joe-elliott opened this issue May 12, 2023 · 1 comment · Fixed by #2530
Closed

[Search Perf] Improve throughput of backendRequests #2469

joe-elliott opened this issue May 12, 2023 · 1 comment · Fixed by #2530

Comments

@joe-elliott
Copy link
Member

For larger queries backendRequests has a large negative impact on performance.

By placing a series of simple log messages in the RoundTrip function we can see that queries that generate a large number of backend requests are negatively impacted.

For this query we created 300k jobs, but only 3000 of them finished because the limit was satisfied. The total time was 16s but you can see that only ~2s was spent searching while ~14s was spent building the backendRequests()

Query Range: 24 hours
Jobs Created: 306917
Jobs Completed: 3102
Total request duration: 16s 

Timings:
2023-05-12 13:40:06.377:  STARTING REQUEST - q= { resource.service.name = "tempo-query-frontend" && duration > 1s} |  
2023-05-12 13:40:19.880: SENDING JOBS - q= { resource.service.name = "tempo-query-frontend" && duration > 1s} |  
2023-05-12 13:40:21.837: REQUEST SATISFIED - q= { resource.service.name = "tempo-query-frontend" && duration > 1s} |  
2023-05-12 13:40:22.219: DONE - q= { resource.service.name = "tempo-query-frontend" && duration > 1s}

Taking the same query but reducing the time range. In this case roughly the exact same number of jobs were completed successfully, but the query took significantly less time simply b/c it created fewer jobs.

Query Range: 3 hours
Jobs Created: 42730
Jobs Completed: 3451
Total request duration: 3.5s 

Timings:
2023-05-12 13:39:42.235 : STARTING REQUEST - q= { resource.service.name = "tempo-query-frontend" && duration > 1s}
2023-05-12 13:39:43.344 : SENDING JOBS - q= { resource.service.name = "tempo-query-frontend" && duration > 1s}
2023-05-12 13:39:45.126 : REQUEST SATISFIED - q= { resource.service.name = "tempo-query-frontend" && duration > 1s}
2023-05-12 13:39:45.136 : DONE - q= { resource.service.name = "tempo-query-frontend" && duration > 1s}

Log lines locations:
STARTING REQUEST
SENDING JOBS
REQUEST SATISIFED
DONE

The most obvious fix (to me) is for backendRequests() to return a channel that the main function consumes. Then we can generate the jobs in parallel.

@mdisibio
Copy link
Contributor

Related: #2464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants