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

Collections API: Reduce Blocking #67

Closed
rajadain opened this issue Aug 21, 2017 · 5 comments
Closed

Collections API: Reduce Blocking #67

rajadain opened this issue Aug 21, 2017 · 5 comments
Assignees
Labels

Comments

@rajadain
Copy link
Member

Currently, the model calls seem to be blocking, so when faced with a large long-running requests, shorter requests have to wait for them to finish.

Investigate returning a Future instead, so the requests can be made lock-free.

@rajadain rajadain added this to the Collections API milestone Aug 21, 2017
@kellyi
Copy link
Contributor

kellyi commented Aug 21, 2017

@mmcfarland
Copy link

See related comment in original issue: #47 (comment)

@kellyi kellyi added in progress and removed queue labels Aug 29, 2017
@kellyi kellyi self-assigned this Aug 29, 2017
@hectcastro
Copy link
Contributor

Even with blocking operations within the scope of a single request/response cycle, we should be able to handle multiple requests in parallel due to the thread pool managed by Akka HTTP to handle connections. You're saying that things block at 2 requests, or when the Akka HTTP thread pool is saturated?

@kellyi kellyi added queue and removed in progress labels Aug 29, 2017
@kellyi kellyi removed their assignment Aug 29, 2017
@kellyi
Copy link
Contributor

kellyi commented Aug 29, 2017

From a comment on #47 (here #47 (comment)):

My suggestion for further optimization is to use Futures for fetching layers in parallel. This would mean changing this method to return a Future[Seq[TileLayerCollection[SpatialKey]]], and spidering the Futures through the codebase. akka-http lets you return a Future from the route, so you could carry the future all the way through to the route.

The comment has more detail, but as part of this issue we should update each of the codepaths to interlace Futures throughout.

@rajadain rajadain self-assigned this Aug 29, 2017
@rajadain
Copy link
Member Author

You're saying that things block at 2 requests, or when the Akka HTTP thread pool is saturated?

It felt like it was blocking at 2 requests when given a very large input, but that may be because of CPU overutilization than thread pool saturation.

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

No branches or pull requests

5 participants