Project

General

Profile

Actions

Bug #62815

closed

hybrid/avl allocators might be very ineffective when serving bluefs allocations

Added by Igor Fedotov 8 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

100%

Source:
Community (dev)
Tags:
backport_processed
Backport:
reef, quincy, pacific
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When operating in best-fit mode these allocators perform chunk lookups through size-sorted "range_size_tree" container. This is done in two stages:

Use container's lower_bound() to search for the first available
long enough chunk.
Iterate sequentially to locate properly aligned chunk,
starting from the position obtained at step 1)
Step 2) might require significant efforts for bluefs allocations (which uses longer allocation unit than bluestore min_alloc_size, e.g. 64K vs. 4K) if space is highly fragmented. Plenty of potentially available chunks might be unaligned to 64K boundary and once aligned they aren't long enough any more.

This spreadsheet shows how dramatic could that be for hybrid allocator (real free map from a production cluster was used to build it):
https://docs.google.com/spreadsheets/d/1bh22JNqwTPSFUQPStYuuiKDEui6YSxZsusIln3tZ9t0/edit?usp=sharing


Related issues 4 (0 open4 closed)

Is duplicate of bluestore - Bug #62509: os/bluestore: suspect performance bottleneck on allocatorDuplicate

Actions
Copied to bluestore - Backport #63760: reef: hybrid/avl allocators might be very ineffective when serving bluefs allocationsResolvedIgor FedotovActions
Copied to bluestore - Backport #63761: quincy: hybrid/avl allocators might be very ineffective when serving bluefs allocationsResolvedActions
Copied to bluestore - Backport #63762: pacific: hybrid/avl allocators might be very ineffective when serving bluefs allocationsResolvedIgor FedotovActions
Actions #1

Updated by Igor Fedotov 8 months ago

Actually the above description is valid for both best- and fast-fit modes. Sequential lookup for 64K aligned chunk might be pretty costly. I've made an experiment where the alignment requirement was changed from 64K to 4K. And allocation times dropped dramatically.
Looks like a good fix to me as large chunk alignment requirement is apparently redundant.

Actions #2

Updated by Igor Fedotov 8 months ago

Originally the issue was revealed a while ago when the following PR was made: https://github.com/ceph/ceph/pull/48640

That implementation is rather an overkill though since we might just get rid off the alignment requirement instead.

Actions #3

Updated by Igor Fedotov 8 months ago

  • Severity changed from 3 - minor to 2 - major
Actions #4

Updated by Igor Fedotov 8 months ago

  • Pull request ID set to 53483
Actions #5

Updated by Igor Fedotov 8 months ago

  • Backport set to reef, quincy, pacific
Actions #6

Updated by Igor Fedotov 7 months ago

  • Status changed from New to Fix Under Review
Actions #7

Updated by Igor Fedotov 7 months ago

  • Is duplicate of Bug #62509: os/bluestore: suspect performance bottleneck on allocator added
Actions #8

Updated by Igor Fedotov 7 months ago

  • Status changed from Fix Under Review to Duplicate
Actions #9

Updated by Igor Fedotov 5 months ago

  • Status changed from Duplicate to Fix Under Review
Actions #10

Updated by Igor Fedotov 5 months ago

Actions #11

Updated by Yuri Weinstein 5 months ago

  • Target version set to v18.2.1

merged

Actions #13

Updated by Igor Fedotov 5 months ago

  • Status changed from Fix Under Review to Pending Backport
Actions #14

Updated by Backport Bot 5 months ago

  • Copied to Backport #63760: reef: hybrid/avl allocators might be very ineffective when serving bluefs allocations added
Actions #15

Updated by Backport Bot 5 months ago

  • Copied to Backport #63761: quincy: hybrid/avl allocators might be very ineffective when serving bluefs allocations added
Actions #16

Updated by Backport Bot 5 months ago

  • Copied to Backport #63762: pacific: hybrid/avl allocators might be very ineffective when serving bluefs allocations added
Actions #17

Updated by Backport Bot 5 months ago

  • Tags set to backport_processed
Actions #18

Updated by Ilya Dryomov 4 months ago

  • Target version deleted (v18.2.1)
Actions #20

Updated by Igor Fedotov about 2 months ago

  • Status changed from Pending Backport to Resolved
Actions #21

Updated by Konstantin Shalygin about 2 months ago

  • Assignee set to Igor Fedotov
  • % Done changed from 0 to 100
  • Source set to Community (dev)
Actions

Also available in: Atom PDF