找回密码
 注册
查看: 590|回复: 3

ceph存储backfills值和recover速度设置

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-10-19 17:00:09 | 显示全部楼层 |阅读模式
ceph daemon osd.2 config show|grep osd_max_backfills
4 u2 b9 s0 }/ T4 [4 l, Z! i3 ^ceph daemon osd.2 config show|grep osd_recovery_max_active
5 D2 f* r$ M! x* c1 I
. J5 B: o8 C7 Y; N0 t# k) |ceph daemon osd.2 config show|grep osd_recovery_sleep
* F4 {1 u! f0 o# w$ T; v
5 }& l8 l  w. X# M" |$ h
. v( e3 f; G+ d. fceph tell osd.* injectargs "--osd_recovery_sleep_hdd=0"" x: L; A0 R! P9 E- X& l& t2 V! K
ceph tell osd.* injectargs "--osd_max_backfills=10"
, |4 K0 G1 m: w7 d1 Sceph tell osd.* injectargs "--osd_recovery_max_active=15") [1 m; [7 {3 G  N: O

/ C( S3 U4 P- G8 X2 ]; x6 Y9 ]: k! L" E- S
同步速度就会上去
% _7 |) P& v; ~$ c- q! y$ [3 @; O* l+ q! y7 }6 H% i

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-10-20 08:33:25 | 显示全部楼层
官方建议的PG使用数量:
" f0 r$ [+ e; g: t9 j( M8 W( {* g) f& K  u: m1 z$ z
集群中小于5个OSD,则设置PG的数量为128。
- R# d: ?7 P$ ^1 K4 H0 s* H集群有5-10个OSD时,设置PG的数量为512。
4 d. y7 e$ |; j! |3 e集群中有10-50个OSD时,设置PG的数量为1024.
6 V- b3 r- d2 E; |当集群中超过50个OSD时,需要权衡PG的数量,有一种公式:( t; s$ U5 ~. J5 V- R

! T+ w. }' S1 N% Z! C& f) H( M! P​ (osd_number * 100)8 O& e% y# c% O# d" e0 ?7 [3 |! `+ U

+ d" M' ~" G* ~pg_num = ------------------------------7 i' b, i7 a  K; p# d- E) B' i# ?
$ z2 x6 N! L- e2 B
​ pool size! H% L- x1 h* q' H3 \5 v

: f7 D( ^0 A1 @) p例如集群有90个OSD,Pool设置的副本数为3:(90*100)÷3=3000
& j$ }3 h3 }" m! B/ u' b% Z2 f7 a% J) m/ i) V
PGP的数量要和PG的数量保持一致。
  j& V7 d% I- i6 k( `+ ]
* H) ]% r( A# j9 }) |- {; `注意这个PG数量是集群所能承担的总PG数量,每个资源池分配多个PG,还需要通过总的PG数乘以资源池占整个集群数据比例,最终拿到一个资源池应该分配多少个PG的数量。

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-11-8 10:35:12 | 显示全部楼层
控制数据恢复及回填速度
) |. Q; m5 |4 W; m1 P# q9 k# 将用于数据恢复操作的优先级提到最高级别
0 E, O6 Y% s/ r3 M5 c7 _- iceph tell osd.* injectargs "--osd_recovery_op_priority=63"
$ ]0 y. I/ d8 K- G
% n, q: A" w  O) t# 将用于client I/O操作的优先级降到3
) e: J3 _) Z$ F6 P7 C! hceph tell osd.* injectargs "--osd_client_op_priority=3"5 ?1 @. ~1 ]0 _2 L+ a3 u' p
. S5 L; k5 o1 g* f# t  v, K2 W
# 将每个osd上用于回填并发操作数由默认的1调整到506 N: d" K7 r# F& o8 t
ceph tell osd.* injectargs "--osd_max_backfills=50". L7 v# c/ J1 Y% Q( ^  F

& W- |& S+ i/ o3 Z3 r2 O# 将每个osd上用于恢复的并发操作数由默认的3调整到50" p# f6 C; }3 L7 D
ceph tell osd.* injectargs "--osd_recovery_max_active=50"9 w" a5 |* ]$ D" V* O# A

  e5 Z# X) [* @1 |6 i# 将每个osd上用于执行恢复的线程数由默认的1调整到104 g# [- N% G) W' ]9 a5 l" d
ceph tell osd.* injectargs "--osd_recovery_threads=10"

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-11-8 10:36:32 | 显示全部楼层
[root@hostceph1 ~]# ceph daemon osd.2 config show|grep osd_max_backfills
% }3 k7 M$ B8 n0 O  G+ Q! M5 t( b$ I    "osd_max_backfills": "1",
6 @2 z1 A: u& v  R+ p! [! `6 V[root@hostceph1 ~]# ceph daemon osd.2 config show|grep osd_recovery_max_active
: M2 k1 S5 j  H6 Q: `7 f    "osd_recovery_max_active": "3",
! f7 o5 l$ e% h4 z[root@hostceph1 ~]# ceph daemon osd.2 config show|grep osd_recovery_sleep
* A  x9 h. I$ X% R    "osd_recovery_sleep": "0.000000",  V6 U; r5 T* M' F/ p8 s
    "osd_recovery_sleep_hdd": "0.100000",
* C& E) d/ }, Y7 d; g    "osd_recovery_sleep_hybrid": "0.025000",
+ K/ ]( ^$ f3 E- ~5 E5 G1 ]    "osd_recovery_sleep_ssd": "0.000000",$ h/ E# X  S! H* P
[root@hostceph1 ~]# ceph daemon osd.2 config show|grep max_backfills+ O8 L0 o8 i" m" W0 R, P
    "osd_max_backfills": "1",' K3 u! M  e1 B9 z' h
[root@hostceph1 ~]# ceph daemon osd.2 config show|grep recovery_max_active' }7 j( A6 p/ P- ^3 [* ]
    "osd_recovery_max_active": "3",, |+ I3 }) V- b2 w( g; u/ d2 u
[root@hostceph1 ~]# ceph daemon osd.2 config show|grep recovery_threads
- a6 G5 O3 A" e7 _0 T0 S[root@hostceph1 ~]# ceph tell osd.* injectargs "--osd_recovery_sleep_hdd=0"
- n) i) B- z9 n9 z/ Mosd.0: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) 2 J! h& j% K! a! ^' R: C0 J! w
osd.1: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
4 m% q- \. R. u  s0 kosd.2: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) / _' H' `- k6 `. {
osd.3: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) & O7 Y' @; h: x9 l/ v4 d+ w) l! M
osd.4: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
: ~; H- Z; F- a# qosd.5: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) 4 r) }& S) g4 q; q4 Y5 P
osd.6: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
+ ?6 g% W2 I# C0 G8 u& p- l' Eosd.7: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) : ~5 h0 m! A# T7 d& {4 D0 V
osd.8: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
8 g2 u6 b; P4 a  t( J! F: f, \osd.9: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
. {" u) b/ M. ~9 q! R# }osd.10: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) 9 Q5 ^  j1 _) j; Z
osd.11: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) 8 C( ~* l8 ?' F& b' |* r: v
osd.12: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
3 Y. u6 e& S% u* f" n8 X& U4 L. B( sosd.13: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) 1 U8 u- w4 l+ H7 |/ \' [% I
osd.14: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) + V2 W& V0 f% k6 ~5 z
osd.15: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) ! e# M% e- y- r* d5 I
osd.16: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) ; T6 Q# K  w3 u" c
osd.17: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) + _: }& w6 {$ X" M
osd.18: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) & P9 h) p, @) x9 ~7 s. q" x
osd.19: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
) G, m) ]8 f) \. J# M" `8 ]osd.20: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) 3 A4 R1 r6 X1 S: w
osd.21: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) ) i) a! ?0 ?' u0 S5 y1 l8 u
osd.22: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
- f9 K1 c' D' b- h7 Posd.23: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
) c% n% ?* j. U0 E5 K0 Gosd.24: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
: z) n* @, ~- w2 Qosd.25: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
: w1 O& G+ y9 J; ^. p& Qosd.26: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) ! }1 S7 X  I8 D9 B/ J
osd.27: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
4 Q: `/ i! P% j5 v+ h% nosd.28: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
2 ^0 o) g. |1 v9 d. C4 eosd.29: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) * r5 u3 M) R3 P4 ?, C# I& k- e
osd.30: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
8 v: c5 O$ S- ~" `. V$ D) nosd.31: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) / z) Y- H$ d2 t
osd.32: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart)
  A7 H6 ^& S3 _" p; tosd.33: osd_recovery_sleep_hdd = '0.000000' (not observed, change may require restart) # Q; q/ F' f4 b/ e8 Y* w" x0 r6 C
[root@hostceph1 ~]# ceph tell osd.* injectargs "--osd_max_backfills=10"* Q& I: p4 z  a& m
osd.0: osd_max_backfills = '10'
( W' g5 z; t/ Vosd.1: osd_max_backfills = '10'
/ _% P  i( i! c3 `osd.2: osd_max_backfills = '10'
0 h5 N4 y+ Q' M9 v* W4 c# N* [5 C* k* uosd.3: osd_max_backfills = '10' 2 @2 ?3 b1 R( L" }
osd.4: osd_max_backfills = '10' 2 f/ k, Q( S& u6 E- F% v) {! {- }6 c( h
osd.5: osd_max_backfills = '10'
1 f+ O. q6 E4 Iosd.6: osd_max_backfills = '10' 6 N  H8 K( v, ]+ P+ d  W5 h
osd.7: osd_max_backfills = '10'
8 J/ Z  o; {9 G. hosd.8: osd_max_backfills = '10'
9 ^$ I- E% @! Vosd.9: osd_max_backfills = '10' ) X2 V' d# Q  W! l
osd.10: osd_max_backfills = '10' 9 f6 D7 v$ o6 F: o3 g3 {
osd.11: osd_max_backfills = '10'
$ N$ M8 e. f6 A  e7 Z) fosd.12: osd_max_backfills = '10'
' z5 ?- Z  q  C& ?' \8 z5 R# ]$ zosd.13: osd_max_backfills = '10' 7 q: D; ~4 p& H- p% E* q
osd.14: osd_max_backfills = '10' 1 j% u$ C! p% F  A. L) Z7 N
osd.15: osd_max_backfills = '10'
# L# c* J4 c8 ?/ josd.16: osd_max_backfills = '10' 5 D( [4 u, J9 K) p6 s
osd.17: osd_max_backfills = '10'
$ }/ C* N6 G+ u) l4 K* G0 wosd.18: osd_max_backfills = '10' 1 Q. s" g' j! i8 h+ D! @
osd.19: osd_max_backfills = '10' # i  A3 V& P  c6 h) {- r. u
osd.20: osd_max_backfills = '10' ' [& ?1 j- `7 T0 S, G- d
osd.21: osd_max_backfills = '10' ) @) b* q" g, Y8 K) w
osd.22: osd_max_backfills = '10'
% A6 \* ]4 w4 @: T" q5 b5 Xosd.23: osd_max_backfills = '10' 4 ?! `/ s1 g& }
osd.24: osd_max_backfills = '10' 4 ^. `7 t# y* \% y) c
osd.25: osd_max_backfills = '10'   J1 @; o. a& W% m" A6 J5 ]  l
osd.26: osd_max_backfills = '10'
* F7 L% F; z/ Zosd.27: osd_max_backfills = '10'
( L% g$ z' @! w2 Y+ ?- fosd.28: osd_max_backfills = '10'
6 \3 W8 ^) p! h# z' R3 [, Josd.29: osd_max_backfills = '10' , b. P. [) X# q" D- b4 A+ j
osd.30: osd_max_backfills = '10' $ v8 F$ x" G4 i) E/ S
osd.31: osd_max_backfills = '10'
1 r% E! X% p* M+ dosd.32: osd_max_backfills = '10' 0 z4 i4 _) m; m: J7 e* s5 O
osd.33: osd_max_backfills = '10'
, Y/ c$ x; {* R) d[root@hostceph1 ~]# ceph tell osd.* injectargs "--osd_recovery_max_active=10"7 \* `2 g0 w% D. z- `3 e
osd.0: osd_recovery_max_active = '10' (not observed, change may require restart)
* ?5 H1 m! ^' k" [4 C  ~osd.1: osd_recovery_max_active = '10' (not observed, change may require restart)
, }2 {: V+ Q5 e" J9 R8 ]+ xosd.2: osd_recovery_max_active = '10' (not observed, change may require restart)
7 V- n# q& |7 m( o. aosd.3: osd_recovery_max_active = '10' (not observed, change may require restart) # Z$ p  r7 q' `- G2 k. `3 W  G" K
osd.4: osd_recovery_max_active = '10' (not observed, change may require restart) 6 ^  {3 n1 N6 n; h3 f8 @
osd.5: osd_recovery_max_active = '10' (not observed, change may require restart)
  q3 `1 a) m$ @" r. sosd.6: osd_recovery_max_active = '10' (not observed, change may require restart) / j0 L: Z& z; L% a/ y  H# J
osd.7: osd_recovery_max_active = '10' (not observed, change may require restart)
' i" D# J/ u& ]. u$ Q+ Rosd.8: osd_recovery_max_active = '10' (not observed, change may require restart) ( m+ i2 W* w% \
osd.9: osd_recovery_max_active = '10' (not observed, change may require restart)
& e+ v; x, m* `9 S! {0 Mosd.10: osd_recovery_max_active = '10' (not observed, change may require restart)
6 ?, K' V5 F9 T" j$ ^osd.11: osd_recovery_max_active = '10' (not observed, change may require restart) 1 E) ?$ q5 O, c5 r4 o0 z
osd.12: osd_recovery_max_active = '10' (not observed, change may require restart)
7 }( y; ^  h3 ^/ ^% Oosd.13: osd_recovery_max_active = '10' (not observed, change may require restart) 9 _. o1 S6 l+ g/ k$ Z
osd.14: osd_recovery_max_active = '10' (not observed, change may require restart)   p2 S9 X9 q+ M$ {  y
osd.15: osd_recovery_max_active = '10' (not observed, change may require restart)
! d6 d5 V- c* m3 |  N' I7 q5 Vosd.16: osd_recovery_max_active = '10' (not observed, change may require restart)
( |7 p- e! Z& V2 uosd.17: osd_recovery_max_active = '10' (not observed, change may require restart) 1 @8 M1 Y4 L8 D  t" m+ r! u1 N
osd.18: osd_recovery_max_active = '10' (not observed, change may require restart) 1 X) i2 {/ ]8 W7 ^1 m
osd.19: osd_recovery_max_active = '10' (not observed, change may require restart) 6 X1 b6 T; t  ~! ^1 k  z5 F
osd.20: osd_recovery_max_active = '10' (not observed, change may require restart)
# g2 A* @6 I! J3 dosd.21: osd_recovery_max_active = '10' (not observed, change may require restart) 1 A) M1 A; H3 ^9 q  ^" I; {
osd.22: osd_recovery_max_active = '10' (not observed, change may require restart)
. G) B- b$ H, M! U9 \osd.23: osd_recovery_max_active = '10' (not observed, change may require restart)
* E9 F# G; x( C8 _2 Y. k3 s  B2 _osd.24: osd_recovery_max_active = '10' (not observed, change may require restart) 4 K- j' h& i( {; V0 k4 ^: }5 Z
osd.25: osd_recovery_max_active = '10' (not observed, change may require restart) & ~: ?4 P; H/ H) E+ `
osd.26: osd_recovery_max_active = '10' (not observed, change may require restart) # D7 {6 V6 `! ?" x# r
osd.27: osd_recovery_max_active = '10' (not observed, change may require restart) 5 h, D) f) I1 c( [& O+ `  S
osd.28: osd_recovery_max_active = '10' (not observed, change may require restart) 9 o' n2 \8 O& @8 }3 r5 X
osd.29: osd_recovery_max_active = '10' (not observed, change may require restart) / {& b9 R; S  ]- i# ]* k6 M  x
osd.30: osd_recovery_max_active = '10' (not observed, change may require restart)
5 P  U  s) o/ O' P4 B2 Eosd.31: osd_recovery_max_active = '10' (not observed, change may require restart)
2 }4 f3 k* `! L+ r  u' Q: r1 s; zosd.32: osd_recovery_max_active = '10' (not observed, change may require restart)
# H1 p0 j# O$ z2 X+ q: d4 `: m- ?osd.33: osd_recovery_max_active = '10' (not observed, change may require restart)
9 ]  f. @# Q% ]- F  R, s# \$ a[root@hostceph1 ~]# ceph -s' z0 j. G1 f9 S& r1 x# v
  cluster:
9 h7 f& @5 b$ b8 J9 A) _9 @1 r    id:     29046cc0-0682-496b-98b1-912e59964282
% a1 Q# [: W$ g, n: d  h& I7 b    health: HEALTH_WARN) W  |  m0 Y( _- s0 b5 T$ }  y
            Reduced data availability: 24 pgs inactive
- Y! J: g/ g# A: q/ E# e2 t( L1 P            24 pgs not deep-scrubbed in time" M! P9 {: W7 ^4 y2 D
            24 pgs not scrubbed in time% L. }/ q$ ?4 i$ a  [

( T" ~3 n% a9 ?! _9 y6 z6 p2 e  services:
: I) c3 q  [7 E% f  P7 t* O    mon: 3 daemons, quorum hostceph1,hostceph2,hostceph3 (age 3M)
* n8 `/ g; F3 Y: N# r    mgr: hostceph2(active, since 3M), standbys: hostceph1, hostceph36 S( e* v* ]8 d5 n$ ]2 H
    osd: 34 osds: 34 up (since 3M), 34 in (since 3M)1 n7 v9 }- P2 }" X

% `7 ]( d, \- y* S$ Z! L8 A4 L; B  data:
7 A9 P- ^, q1 H  p+ e    pools:   9 pools, 5760 pgs, E! T: }) [8 B  h5 h. {
    objects: 3.11M objects, 12 TiB
9 m5 F5 q% i. D" W+ j: l3 \- J    usage:   33 TiB used, 92 TiB / 126 TiB avail
5 i- x+ H9 X$ n3 E    pgs:     0.417% pgs unknown! Y6 Q& `7 R0 |; Z3 R: h
             5735 active+clean( O% h5 R  y; O8 Y
             24   unknown
3 V6 I3 c4 h' z4 ?" e             1    active+clean+scrubbing+deep
" p4 T! M# y/ z: {( M3 D" ^9 U; Z 1 u7 [% w0 W7 E) \1 P' j" k$ ^" e
  io:
% o/ n* z1 U) S8 w5 t8 q7 @, t    client:   212 KiB/s rd, 20 MiB/s wr, 258 op/s rd, 647 op/s wr
) y7 J$ d1 t: A
# S- A5 V4 ]% j[root@hostceph1 ~]# ceph -s0 p7 d) k* N0 u& Y
  cluster:4 Q! S8 r* z5 V/ s. c" W9 t9 {3 O
    id:     29046cc0-0682-496b-98b1-912e59964282. t$ _5 b4 J/ x" W# E; [% i2 j
    health: HEALTH_WARN
7 A5 X9 b+ G3 H            Reduced data availability: 24 pgs inactive
0 s# {2 |6 p' w  ~( y            24 pgs not deep-scrubbed in time
( B) ?. i. Q9 J+ E4 Q  p2 K1 t6 m            24 pgs not scrubbed in time
! k$ P+ H. \% l7 n
: f; ~# ~/ D! v$ b$ U2 p  services:
+ x& C, |3 ]! I1 A5 G, D8 T    mon: 3 daemons, quorum hostceph1,hostceph2,hostceph3 (age 3M)1 M$ z" g% J7 }9 [
    mgr: hostceph2(active, since 3M), standbys: hostceph1, hostceph38 b0 h2 F: e& h3 \6 v
    osd: 34 osds: 34 up (since 3M), 34 in (since 3M)
% |# `/ u. [+ S& x! T) @ " W, O6 ?$ l$ O) b
  data:
! j; E( a8 U5 W/ p. f    pools:   9 pools, 5760 pgs9 I' @+ F5 k$ r4 b- U* v) F) h8 @
    objects: 3.11M objects, 12 TiB
. d. Y1 m. W; A5 }' c    usage:   33 TiB used, 92 TiB / 126 TiB avail
! I& k5 J+ |! v! }    pgs:     0.417% pgs unknown
# a& ?/ B7 u! F2 H$ o+ ]. C$ c             5735 active+clean
5 Z0 w3 a7 M4 B  c6 r. @) A             24   unknown0 a+ Y# E- N  o# X2 \! O
             1    active+clean+scrubbing+deep
. P! O# X4 \- l! |) k4 Y 5 }7 \5 ~* q' k8 |' h
  io:
4 R! i: w  z8 q6 e9 s% M    client:   9.7 KiB/s rd, 20 MiB/s wr, 12 op/s rd, 625 op/s wr
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-11 23:01 , Processed in 0.023909 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表