Chapter 9. Primary Affinity
When a Ceph Client reads or writes data, it always contacts the primary OSD in the acting set. For set [2, 3, 4]
, osd.2
is the primary. Sometimes an OSD isn’t well suited to act as a primary compared to other OSDs (e.g., it has a slow disk or a slow controller). To prevent performance bottlenecks (especially on read operations) while maximizing utilization of your hardware, you can set a Ceph OSD’s primary affinity so that CRUSH is less likely to use the OSD as a primary in an acting set. :
ceph osd primary-affinity <osd-id> <weight>
Primary affinity is 1
by default (i.e., an OSD may act as a primary). You may set the OSD primary range from 0-1
, where 0
means that the OSD may NOT be used as a primary and 1
means that an OSD may be used as a primary. When the weight is < 1
, it is less likely that CRUSH will select the Ceph OSD Daemon to act as a primary.