Skip to content

Fix query node scalability issues#4366

Merged
mnaamani merged 2 commits intoJoystream:carthagefrom
Lezek123:carthage-adjust-hydra
Oct 18, 2022
Merged

Fix query node scalability issues#4366
mnaamani merged 2 commits intoJoystream:carthagefrom
Lezek123:carthage-adjust-hydra

Conversation

@Lezek123
Copy link
Copy Markdown
Contributor

@Lezek123 Lezek123 commented Oct 11, 2022

Fixes #4360
Partially relies on Joystream/hydra#510, which introduces additional optimalization and prevents unnecessary event entity size bloat.

Processor parameters

By setting BATCH_SIZE=100 and QUEUE_FACTOR=1 we limit the number of events fetched from the indexer to 100 in a single query. This is because in worst case scenario an event can be ~5 MB in size (max block size), which gives 500 MB of data. Serializing data to a string larger than 512 MB can already cause issues on 32-bit platforms.

With QUEUE_MAX_CAP_FACTOR=4 we allow 4x more events to be stored in memory, so ~2 GB in worst case scenario.

Impact of this PR on indexing/processing speed

Empty blocks

  • Indexing speed: ~19 blocks / second => ~19 blocks / second (no change)
  • Processing speed: ~1000 blocks / second => ~1000 blocks / second (no change)

batchSize=100 members migration (4400 members over 176 blocks)

  • Indexing speed: 26s => 14s (-12s / -46%)
  • Processing speed: 27s => 30s (+3s / +11%)

batchSize=1000 members migration (4400 members over 18 blocks)

  • Indexing speed: 135s => 6s (-129s / -95%)
  • Processing speed: ERROR => 68s

┆Issue is synchronized with this Asana task by Unito

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
pioneer-testnet ⬜️ Ignored (Inspect) Oct 13, 2022 at 7:37AM (UTC)

@Lezek123 Lezek123 marked this pull request as draft October 11, 2022 17:17
@Lezek123 Lezek123 requested a review from mnaamani October 13, 2022 15:21
@Lezek123 Lezek123 marked this pull request as ready for review October 13, 2022 15:21
@bedeho bedeho requested review from zeeshanakram3 and removed request for mnaamani October 17, 2022 08:36
Copy link
Copy Markdown
Contributor

@zeeshanakram3 zeeshanakram3 left a comment

Choose a reason for hiding this comment

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

LGTM

@Lezek123 Lezek123 requested a review from mnaamani October 18, 2022 13:34
@mnaamani mnaamani requested review from mnaamani and removed request for mnaamani October 18, 2022 14:19
@mnaamani mnaamani merged commit 57b3e83 into Joystream:carthage Oct 18, 2022
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.

3 participants