Skip to content

[fix][broker] calculate default cache size correctly in standalone mode - #18217

Merged
codelipenghui merged 3 commits into
apache:masterfrom
labuladong:fix-standalone-conf
Oct 31, 2022
Merged

codelipenghui merged 3 commits into
apache:masterfrom
labuladong:fix-standalone-conf

Conversation

@labuladong

@labuladong labuladong commented Oct 27, 2022 •

Copy link
Copy Markdown
Contributor

Fixes #18206

Motivation

Calculate dbStorage_readAheadCacheMaxSizeMb and dbStorage_writeCacheMaxSizeMb correctly in standalone mode to avoid OOM.

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: labuladong#4

@github-actions github-actions Bot added the doc-complete Your PR changes impact docs and the related docs have been already added. label Oct 27, 2022
@labuladong

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

2 similar comments
@labuladong

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@labuladong

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@codelipenghui codelipenghui left a comment

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.

Is it able to fix the PulsarStandaloneStarter? I mean we can rewrite the memory configurations according to how many bookies will start in the standalone.

Looks like If we have 2GB direct memory in total, 1 broker, and 2 bookies. We can assign 667 MB of direct memory for each broker and bookie. Then we can rewrite like dbStorage_writeCacheMaxSizeMb = 0.25 * 667

@labuladong

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@labuladong

Copy link
Copy Markdown
Contributor Author

Thanks for the hint, I'll try to fix it : ) @codelipenghui

@labuladong
labuladong marked this pull request as draft October 29, 2022 09:03
@labuladong
labuladong marked this pull request as ready for review October 29, 2022 09:04
@labuladong

Copy link
Copy Markdown
Contributor Author

PTAL @codelipenghui

@labuladong labuladong changed the title [fix][broker] decrease default cache size in standalone mode [fix][broker] calculate default cache size correctly in standalone mode Oct 31, 2022
@codecov-commenter

codecov-commenter commented Oct 31, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #18217 (7223ff1) into master (6c65ca0) will increase coverage by 3.82%.
The diff coverage is 34.64%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #18217      +/-   ##
============================================
+ Coverage     34.91%   38.74%   +3.82%     
- Complexity     5707     8261    +2554     
============================================
  Files           607      683      +76     
  Lines         53396    67326   +13930     
  Branches       5712     7217    +1505     
============================================
+ Hits          18644    26085    +7441     
- Misses        32119    38241    +6122     
- Partials       2633     3000     +367     
Flag Coverage Δ
unittests 38.74% <34.64%> (+3.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...org/apache/bookkeeper/mledger/LedgerOffloader.java 0.00% <ø> (ø)
...che/bookkeeper/mledger/LedgerOffloaderFactory.java 0.00% <ø> (ø)
...pache/bookkeeper/mledger/LedgerOffloaderStats.java 0.00% <ø> (ø)
...ookkeeper/mledger/LedgerOffloaderStatsDisable.java 0.00% <ø> (ø)
...a/org/apache/bookkeeper/mledger/ManagedCursor.java 85.71% <ø> (ø)
...che/bookkeeper/mledger/ManagedLedgerException.java 41.17% <ø> (ø)
...bookkeeper/mledger/ManagedLedgerFactoryConfig.java 86.66% <ø> (ø)
...g/apache/bookkeeper/mledger/ManagedLedgerInfo.java 22.22% <ø> (ø)
...he/bookkeeper/mledger/OffloadedLedgerMetadata.java 0.00% <ø> (ø)
...ava/org/apache/bookkeeper/mledger/ScanOutcome.java 0.00% <ø> (ø)
... and 728 more

@labuladong

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@codelipenghui
codelipenghui merged commit c5135f1 into apache:master Oct 31, 2022
labuladong added a commit to labuladong/pulsar that referenced this pull request Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-complete Your PR changes impact docs and the related docs have been already added. ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] OutOfDirectMemoryError when pulsar standalone start with multiple bookie

4 participants