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

OAK-11158 - indexing-job/downloader - Move the conversion of Mongo responses to NodeDocument from the download to the transform threads (WIP) #1753

Open
wants to merge 13 commits into
base: trunk
Choose a base branch
from

Conversation

nfsantos
Copy link
Contributor

@nfsantos nfsantos commented Oct 2, 2024

Currently, the download thread is iterating over the response receive from Mongo by converting the response to NodeDocument instances. This is a fairly expensive operation, that can account for more than 50% of the time of the download threads. While the download thread is processing the answer, it is blocked from requesting more data from Mongo, which is often the bottleneck.

We can instead convert the Mongo documents to a RawBsonDocument, which is just a copy of the binary buffer representing a Mongo document. This is a very fast operation, as it requires only making a copy the binary buffer. We can then pass these RawBsonDocuments to the transform threads, which will then convert them to NodeDocument.

This moves the heavy work of parsing the answer away from the download threads, which should significantly improve the download speed as the download threads will take less time to process each Mongo response and will more quickly send the next request. To deal with the extra load of the transform threads, we can increase their number, which currently is set to 2.

…nsidered for download by matching only against the indexes for which the feature is enabled. Previously, it was checking against all indexes, which could lead to downloading blobs for nodes that are not indexed by an index that needs the blob.

Add tests for AOT blob downloader.
… download to the transform phase, which alleviates the load on the download threads, speeding up download.
@nfsantos nfsantos changed the title OAK-11158 - indexing-job/downloader - Move the conversion of Mongo responses to NodeDocument from the download to the transform threads OAK-11158 - indexing-job/downloader - Move the conversion of Mongo responses to NodeDocument from the download to the transform threads (WIP) Oct 2, 2024
@nfsantos nfsantos marked this pull request as ready for review October 2, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant