Skip to content
New issue

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

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

Already on GitHub? # to your account

WIP: improve EDDB download and update times #23

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

chennin
Copy link

@chennin chennin commented Nov 15, 2021

Switches to bulk Mongo updates. On my 2CPU/2GB test VM, factions download and update goes from 90s to 7s. However, systems update is still unable to complete, and the others take about 10 minutes each.

Disclaimer: literally never touched Node before

On a better 4CPU/8GB test VM, I get:
commodity: ~6m 15s
factions: ~5s
stations: ~6m45s
populatedSystems: ~45s
...

TODO: bulkWrite does not invoke middleware. Check on the other middleware in the models and copy them.

updateOne: {
filter: {
id: json.id,
// updated_at: { $ne: json.updated_at }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is commented out because otherwise, Mongo returns a duplicate key error for every record NOT updated. It still updates any changed field, eg 0 inserted, 1000 matched, 1 modified, 0 upserted

@chennin chennin marked this pull request as draft November 15, 2021 21:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant