]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: Update PGSnapTrim op queue item cost to reflect average object size
authorSridhar Seshasayee <sseshasa@redhat.com>
Mon, 20 Nov 2023 13:17:14 +0000 (18:47 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 27 Nov 2023 16:00:33 +0000 (21:30 +0530)
commitfbd5c40edccccbb44b66e9d82fc71b14ac1d04ae
tree43115c783724bf1aa6ce4c0b97d22cc16a084bd0
parent08b2255c345b0614cb1e1e4e3435910235c677cd
osd: Update PGSnapTrim op queue item cost to reflect average object size

Previously, a static value of snap_trim_cost (1 MiB by default) for
PGSnapTrim item was used (see config option osd_snap_trim_cost). For pools
with significantly different sizes of objects, the static cost doesn't
accurately estimate the amount of IO each snap trim operation requires.
Instead, add a cost_per_object parameter to OSDService::queue_for_snap_trim
and set it to the average object size in the PG being queued by using
PG::get_average_object_size().

In addition, for the mClock scheduler, the cost_per_object is multiplied
by the actual number of object trimmed per iteration. This multiplier is
represented by osd_pg_max_concurrent_snap_trims config option which is
used when the actual work starts (See DoSnapWork).

Note: The above cost calculation is valid for most snap trim
iterations except for:

1. The penultimate iteration which may return only 1 object to be trimmed,
in which case the cost will be off by a factor equivalent to the average
object size.

2. The final iteration (returns -ENOENT), involving clean-ups.

Fixes: https://tracker.ceph.com/issues/63604
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/PrimaryLogPG.cc