Skip to content

SDSTOR-21407 Make per-service dev_type and size_pct configurable in i…#411

Merged
xiaoxichen merged 2 commits into
eBay:stable/v4.xfrom
xiaoxichen:config_ratio
May 11, 2026
Merged

SDSTOR-21407 Make per-service dev_type and size_pct configurable in i…#411
xiaoxichen merged 2 commits into
eBay:stable/v4.xfrom
xiaoxichen:config_ratio

Conversation

@xiaoxichen
Copy link
Copy Markdown
Collaborator

…nit_homestore

Add HSDevTypeOverride enum and per-service {meta,log,index,replication}_{dev_type,size_pct} fields to HSBackendSettings. Defaults are AUTO/-1.0 so existing hybrid/single mode logic is fully preserved. When a config value is set it overrides the built-in default via resolve_dev_type() and resolve_size_pct() helpers.

Also tune standalone (single-device) defaults: meta/index 5%- >1%, replication 79%->87%.

…nit_homestore

Add HSDevTypeOverride enum and per-service {meta,log,index,replication}_{dev_type,size_pct}
fields to HSBackendSettings. Defaults are AUTO/-1.0 so existing hybrid/single mode logic
is fully preserved. When a config value is set it overrides the built-in default via
resolve_dev_type() and resolve_size_pct() helpers.

Also tune standalone (single-device) defaults: meta/index 5%- >1%, replication 79%->87%.

Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 53.84615% with 12 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (stable/v4.x@88b936f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/lib/homestore_backend/hs_homeobject.cpp 53.84% 12 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff               @@
##             stable/v4.x     #411   +/-   ##
==============================================
  Coverage               ?   53.01%           
==============================================
  Files                  ?       36           
  Lines                  ?     5302           
  Branches               ?      657           
==============================================
  Hits                   ?     2811           
  Misses                 ?     2199           
  Partials               ?      292           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

});
} else {
auto run_on_type = has_fast_dev ? homestore::HSDevType::Fast : homestore::HSDevType::Data;
LOGD("Running with Single mode, all service on {}", run_on_type);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: if we have different final HSDevType for different service, it is better to print them respectively.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ack

Comment thread docs/adr/blob-index-analyze.md Outdated
- **Allocator overhead:** ~0.2% of S
- Uses `FixedBlkAllocator` (4KB fixed block size)
- Maintains all free blocks in memory via `folly::MPMCQueue`
- Each slot: 12 bytes (4B blk_num_t + 8B atomic sequence)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sequence is atomic < uint32 >, so it is 4B, and each slot is 8B?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, nice catch, I copied this from the GDB result from Mehdi but actually he was in older version where BlkId (6B) was used for MPMCQ , 6+4=10 then padded to 12.

In 7.x we are using blk_num_t instead of blk_idwhich is 4B , then no padding is needed

Comment thread docs/adr/blob-index-analyze.md Outdated
```
Worst case assuming blob size is 8KB, the Index size should be 0.61% of DataSize

(DataSize/8K)*(4KB/167)*1.01 ==> DataSize *1.01/167 = DataSize * 0.61%.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

8K/ 4K = 2?

it should be ( (DataSize/8K) / 167 ) *4k * 1.01 = DataSize * 0.3%.

Comment thread docs/adr/blob-index-analyze.md Outdated
Now we use 45% of META drive (200GB*45% =90GB) on HDD SKUs. The number is generally correct as worst case we can consume up to 60GB.
Shrinking it down from 90GB to 60GB saves 60MB memory which is negligible.
#### [QLC SKU]
5% of QLC size makes it into 5721.96 GB, as a result it consumes 18GB memory for allocator.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you also put the capacity of a QLS SSD here to make it more clear

Comment thread docs/adr/blob-index-analyze.md Outdated
3. Hard memory = Index disk / 4096 × 12 bytes
(Allocator) (Always resident, non-negotiable)

4. Soft memory = min(Index disk × 10%, io_mem_size × 65%)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what does Index disk × 10% mean?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

trying to say keeping 10% of index in the memory for hot data (if any)

Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
Copy link
Copy Markdown
Collaborator

@JacksonYao287 JacksonYao287 left a comment

Choose a reason for hiding this comment

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

LGTM

@xiaoxichen xiaoxichen merged commit 2de356a into eBay:stable/v4.x May 11, 2026
64 of 73 checks passed
@Besroy
Copy link
Copy Markdown
Contributor

Besroy commented May 11, 2026

LGTM, but I’m a bit confused about the use case for config dev_type configurable. What is its priority compared to the device type detected by HO? Since the dev info used by HS is detected by HO, but the vdev creation relies on the parameters specified in HO’s hs_format_params, does this mean the physical disk type remains as detected unless the override doesn’t change the hybrid/single mode, and HS’s vdev can be deployed on any disk type in this case? Also, is the cumulative percentage for the same type being kept under 100% ensured by HS’s checks?

@xiaoxichen
Copy link
Copy Markdown
Collaborator Author

@Besroy

  1. the configuration takes priority , if configuration is wrong then the disk init would fail.
  2. if the config is not set, auto-detect would be used.
  3. I dont have clear use case for over-ridding the dev-type for specific vdev as of now... Honestly i even dont think we should tune the ratio once we have a good number for LOG, but makes them into config makes tuning easier in future.
  4. the <100% is ensured by HS.

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.

4 participants