Project

General

Profile

Actions

Bug #81902

open
NM NM

mgr: prometheus, pg_autoscaler and balancer rebuild full pg_dump/OSDMap dumps every loop, causing high CPU and memory at scale

Bug #81902: mgr: prometheus, pg_autoscaler and balancer rebuild full pg_dump/OSDMap dumps every loop, causing high CPU and memory at scale

Added by Nitzan Mordechai about 2 months ago. Updated about 1 month ago.

Status:
Fix Under Review
Priority:
High
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
umbrella, tentacle
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

On large clusters the mgr uses a lot of CPU and memory. Three modules rebuild
large Python objects (the full pg_dump or a full OSDMap dump) on every loop,
while holding the GIL, just to read a few fields. The same data is already
available from a smaller key or from the mgr api cache.

Per module:

prometheus
get_pool_repaired_objects() calls get('pg_dump') and walks all PGs only to
sum repaired objects per pool. 'pool_stats' gives the same data
(PGMap::dump_pool_stats()) and is much smaller. Also, three steps of
collect() are not covered by @profile_method(), so they are missing from
prometheus_collect_duration_seconds.

pg_autoscaler
Every serve loop calls OSDMap.dump() to read flags, pools and
require_osd_release. These are already in the cached 'osd_map'. The pool
list is used together with the OSDMap object, so the cache can only be used
when its epoch matches the OSDMap epoch.

balancer
Plan calls osdmap.dump() when it is created. It can use the cached 'osd_map'
instead, with the same epoch check.

Case Metric Before After Change
100 OSDs / 32K PGs RSS mean 1021 MB 387 MB -62%
RSS max 1187 MB 391 MB -67%
CPU mean 93% 28% -70%
CPU max 132% 55% -59%
prometheus collect 9.4 s 0.76 s -92%
300 OSDs / 64K PGs RSS mean 1946 MB 771 MB -60%
RSS max 2378 MB 772 MB -68%
CPU mean 138% 61% -55%
CPU max 180% 121% -33%
prometheus collect 127 s 2.4 s -98%

NM Updated by Nitzan Mordechai about 1 month ago Actions #1

  • Backport set to umbrella, tentacle
Actions

Also available in: PDF Atom