Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

CPU block effort - 1.8 #8507

Merged
merged 19 commits into from
Feb 5, 2020
Merged

CPU block effort - 1.8 #8507

merged 19 commits into from
Feb 5, 2020

Conversation

heifner
Copy link
Contributor

@heifner heifner commented Jan 25, 2020

Change Description

CPU block effort provides a mechanism to restrict the amount of time a producer is processing transactions for inclusion into a block. It also controls the time a producer will finalize/produce and transmit a block. Block construction now always begins at whole or half seconds for the next block.

Added new options cpu-effort-percent & last-block-cpu-effort-percent defaulted to 80%. Percentage of cpu block production time used to produce block. Whole number percentages, e.g. 80 for 80%.

These options allow time outside of start_block for other system activity such as net_plugin sending/receiving blocks, signing of block, etc.

Existing options produce-time-offset-us & last-block-time-offset-us have been modified to constrain configurable values from 0 .. -block_time_interval where currently block_time_interval is 500,000us. Positive values are no longer allowed.

The default value of produce-time-offset-us is now effectively -100000 since cpu-effort-percent is defaulted to 80%.

These four options now all fold into restricting the amount of time spent processing transactions into a block. The last-block-* options constrain the final 12th block of the producer's round. The other two options constrain the remaining blocks of the round, 1-11. The more constraining amount is used. For example, --cpu-effort-percent 80 --produce-time-offset-us -300000 will constrain transaction processing to 200ms as 80% x 500ms = 400ms and 500ms - 300ms = 200ms.

Other examples:
--cpu-effort-percent 70 --produce-time-offset-us -100000 provides 350ms for transaction processing.
--last-block-cpu-effort-percent 70 --last-block-time-offset-us -400000 provides 100ms for transaction processing for the last block of the round

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

See above.

@heifner heifner requested a review from arhag January 25, 2020 19:27
…ock-time-offset-us & last-block-cpu-duty-cycle-pct together. These config options now specify the amount of time of the 500ms block interval to use for producing a block. The existing options produce-time-offset-us & last-block-time-offset-us are now restricted to the 500ms block interval; they no longer allow positive offsets. Offsets are now always in term of the block time.
@jjzhangg
Copy link

jjzhangg commented Jan 29, 2020

Can we automatically calculate the percentage based on the CPU performance, and we can control that by setting below configuration in eosio.

  1. cpu-frequency-min: 4Ghz
  2. cpu-frequency-max: 5Ghz
  3. plus, we can refuse to start bp node, when a bp's CPU does not meet the requirement.
  4. Still bp can override this percentage by setting in config.ini
    @heifner

@heifner
Copy link
Contributor Author

heifner commented Jan 29, 2020

@jjzhangg We would like to explore automatically adjusting this setting in a running system. However, tying it to cpu frequency I don't think is any different than this pull request of just setting a percentage. Instead it would be nice to adjust according to latency/load/forks or other heuristics.

@heifner heifner changed the title CPU Duty cycle - 1.8 CPU block effort - 1.8 Jan 29, 2020
…y-cyle-pct to last-block-cpu-effort-percent to better describe the options.
@heifner heifner merged commit 5baa6b2 into release/1.8.x Feb 5, 2020
@heifner heifner deleted the duty-cycle-1.8 branch February 5, 2020 00:58
@heifner heifner mentioned this pull request Feb 6, 2020
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants