I configured Ceph with the recommended values (using a formula from the docs). I have 3 OSDs, and my config (which I've put on the monitor node and all 3 OSDs) includes this:
osd pool default size = 2
osd pool default min size = 1
osd pool default pg num = 150
osd pool default pgp num = 150
When I run ceph status
I get:
health HEALTH_WARN
too many PGs per OSD (1042 > max 300)
This is confusing for two reasons. First, because the recommended formula did not satisfy Ceph. Second, and most puzzling, is that it says I have 1042 PGs per OSD, when my configuration says 150.
What am I doing wrong?
How I fixed it in 12.2.4 luminous:
Too many PGs per OSD (380 > max 200) may lead you to many blocking requests.
First you need to set:
Then restart all MONs and OSDs, one by one.
Check the value:
Now look here:
In my case by default
pg_num
was 128 or something like that (my cluster is 4 years old, it was a lot of upgrades a lot of changes). You can reduce it like that.Be careful:
If it wasn't enough, try to find another pool you can cut.
Before setting PG count you need to know 3 things.
1. Number of OSD
2. Number of Pools
ceph osd pool ls
orrados lspools
3. Replication Count
Now Let get into calculation
Calculations:
Total PGs Calculation:
Example:
No of OSD: 3
No of Replication Count: 2
Total PGs = (3 * 100) / 2 = 150. Nearest Power of 150 to 2 is 256.
So Maximum Recommended PGs is 256
You can set PG for every Pool
Total PGs per pool Calculation:
Example:
No of OSD: 3
No of Replication Count: 2
No of pools: 5
Total PGs = ((3 * 100) / 2 ) / 5 = 150 / 5 = 30 . Nearest Power of 30 to 2 is 32.
So Total No of PGs per pool is 32.
Power of 2 Table:
Useful Commands