Skip to content

Limit batch size for block processor#4655

Merged
pwojcikdev merged 2 commits intonanocurrency:developfrom
pwojcikdev:blockprocessor-batch-size
Jul 3, 2024
Merged

Limit batch size for block processor#4655
pwojcikdev merged 2 commits intonanocurrency:developfrom
pwojcikdev:blockprocessor-batch-size

Conversation

@pwojcikdev
Copy link
Copy Markdown
Contributor

This limits a single block processor batch size to 256 blocks. This makes batch sizes uniform across all components. Additionally, if disk is slow and database transaction is held longer than 500ms, the transaction is refreshed during batch processing.

@pwojcikdev pwojcikdev changed the title Limited batch sizes for block processor Limit batch size for block processor Jun 23, 2024
Copy link
Copy Markdown
Contributor

@clemahieu clemahieu left a comment

Choose a reason for hiding this comment

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

Minor question about getting batches from the fair_queue though otherwise LGTM. This was a badly needed cleanup.


lock_a.lock ();
std::deque<context> results;
while (!queue.empty () && results.size () < max_count)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't fair_queue already have a next_batch()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It has, but there were some additional checks in the block_processor::next () so it wasn't a drop in replacement.

@pwojcikdev pwojcikdev merged commit 339c819 into nanocurrency:develop Jul 3, 2024
@qwahzi qwahzi added this to the V27 milestone Jul 11, 2024
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