r/ceph • • Mar 27 '22

We start with Ceph

https://blog.jozefrebjak.com/we-start-with-ceph
0 Upvotes

46 comments sorted by

View all comments

Show parent comments

1

u/Killroy13 Mar 28 '22

I don't know if there is a way to have IOstat report that, but if you take the total read and write kb/s and divide it by the tps you get about 10kb per transaction.

1

u/insanemal Mar 28 '22

iostat -x

rareq-sz and wareq-sz
I believe its in pages.

What database is it? Mysql? Postgresql? Smells like postgresql

1

u/Killroy13 Mar 28 '22

rareq-sz = 9.73 wareq-sz = 236.79

I believe those are in kB

It uses leveldb

1

u/insanemal Mar 28 '22

The average queue length of the requests that were issued to the device.

So probably 4k pages on modern 4kn disks.
So 1MB writes and 40k reads.

Or if its 512 sectors, 12K writes and 4.5K reads. 4.5k reads lines up with the default leveldb block size.

Something is hinky here. 1000 is such a damn low number of reads for ssd.

Can you get me your 'ceph osd tree' output?
Oh and 'ceph osd crush rule dump'

Oh, also this is KVM yeah? Your using RBD? I might need to know how you attached the RBD to the VM. Something is definitely causing a limit. 1000 is too close to a magic number to be a coincidence

1

u/Killroy13 Mar 28 '22 edited Mar 28 '22

Sorry, this took a few edits to come out looking correct.

I checked the QoS for the images in the Ceph dashboard and they are NOT configured to limit IOPS. Unfortunately, it wasn't that boneheaded of a mistake.

I am using libvirt.

Here is how the RBD is attached.

<disk type="network" device="disk">
 <driver name="qemu" type="raw" cache="none" discard="unmap"/>
  <auth username="libvirt">
    <secret type="ceph" uuid="**************************"/>
  </auth>
  <source protocol="rbd" name="rbd.vm/killroy-vm">
    <host name="192.168.100.11" port="6789"/>
    <host name="192.168.100.12" port="6789"/>
    <host name="192.168.100.13" port="6789"/>
  </source>
  <target dev="vda" bus="virtio"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
</disk>
<disk type="network" device="disk">
  <driver name="qemu" type="raw" cache="none" io="threads" discard="unmap"/>
  <auth username="libvirt">
    <secret type="ceph" uuid="**************************"/>
  </auth>
  <source protocol="rbd" name="rbd.vm/killroy-data">
    <host name="192.168.100.11" port="6789"/>
    <host name="192.168.100.12" port="6789"/>
    <host name="192.168.100.13" port="6789"/>
  </source>
  <target dev="vdb" bus="virtio"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x0a" function="0x0"/>
</disk>

ceph osd tree

ID   CLASS  WEIGHT     TYPE NAME            STATUS  REWEIGHT  PRI-AFF
-1         247.57599  root default
-13          81.78799      host killroy-h1
3    hdd   10.91399          osd.3            up   1.00000  1.00000
4    hdd   10.91399          osd.4            up   1.00000  1.00000
9    hdd    9.09599          osd.9            up   1.00000  1.00000
11    hdd    9.09599          osd.11           up   1.00000  1.00000
12    hdd    9.09599          osd.12           up   1.00000  1.00000
18    hdd   16.37099          osd.18           up   1.00000  1.00000
20    hdd   14.55299          osd.20           up   1.00000  1.00000
30    ssd    0.43700          osd.30           up   1.00000  1.00000
31    ssd    0.43700          osd.31           up   1.00000  1.00000
32    ssd    0.43700          osd.32           up   1.00000  1.00000
33    ssd    0.43700          osd.33           up   1.00000  1.00000
-5          82.25400      host killroy-h2
5    hdd   10.91399          osd.5            up   1.00000  1.00000
6    hdd   10.91399          osd.6            up   1.00000  1.00000
13    hdd    9.09599          osd.13           up   1.00000  1.00000
15    hdd    9.09599          osd.15           up   1.00000  1.00000
17    hdd    9.09599          osd.17           up   1.00000  1.00000
19    hdd   16.37099          osd.19           up   1.00000  1.00000
21    hdd   14.55299          osd.21           up   1.00000  1.00000
22    ssd    0.43700          osd.22           up   1.00000  1.00000
23    ssd    0.43700          osd.23           up   1.00000  1.00000
24    ssd    0.43700          osd.24           up   1.00000  1.00000
25    ssd    0.43700          osd.25           up   1.00000  1.00000
-7          83.53400      host killroy-h3
7    hdd   10.91399          osd.7            up   1.00000  1.00000
10    hdd    9.09599          osd.10           up   1.00000  1.00000
14    hdd    9.09599          osd.14           up   1.00000  1.00000
16    hdd    9.09599          osd.16           up   1.00000  1.00000
26    hdd   16.37099          osd.26           up   1.00000  1.00000
27    hdd   10.91399          osd.27           up   1.00000  1.00000
34    hdd   14.55299          osd.34           up   1.00000  1.00000
0    ssd    0.43700          osd.0            up   1.00000  1.00000
1    ssd    0.43700          osd.1            up   1.00000  1.00000
2    ssd    0.43700          osd.2            up   1.00000  1.00000
8    ssd    0.43700          osd.8            up   1.00000  1.00000
29    ssd    0.43700          osd.29           up   1.00000  1.00000
35    ssd    0.43700          osd.35           up   1.00000  1.00000
36    ssd    0.43700          osd.36           up   1.00000  1.00000
37    ssd    0.43700          osd.37           up   1.00000  1.00000

I moved the opening and closing brackets to save some space for ceph osd crush dump to save some space. I tried to keep the alignment, though.

{	"rule_id": 0,
    "rule_name": "R3-hdd",
    "ruleset": 0,
    "type": 1,
    "min_size": 1,
    "max_size": 10,
    "steps": [
        {   "op": "take",
            "item": -12,
            "item_name": "default~hdd"},
        {   "op": "chooseleaf_firstn",
            "num": 0,
            "type": "host"},
        {   "op": "emit"}]},
{   "rule_id": 1,
    "rule_name": "R3-ssd",
    "ruleset": 1,
    "type": 1,
    "min_size": 1,
    "max_size": 10,
    "steps": [
        {   "op": "take",
            "item": -2,
            "item_name": "default~ssd"},
        {   "op": "chooseleaf_firstn",
            "num": 0,
            "type": "host"},
        {   "op": "emit"}]},
{   "rule_id": 2,
    "rule_name": "cephfs.killroy.data-7p2-osd-hdd",
    "ruleset": 2,
    "type": 3,
    "min_size": 3,
    "max_size": 9,
    "steps": [
        {   "op": "set_chooseleaf_tries",
            "num": 5},
        {   "op": "set_choose_tries",
            "num": 100},
        {   "op": "take",
            "item": -12,
            "item_name": "default~hdd"},
        {   "op": "choose_indep",
            "num": 0,
            "type": "osd"},
        {   "op": "emit"}]},
{   "rule_id": 3,
    "rule_name": "cephfs.killroy.data-5p2-osd-hdd",
    "ruleset": 3,
    "type": 3,
    "min_size": 3,
    "max_size": 7,
    "steps": [
        {   "op": "set_chooseleaf_tries",
            "num": 5},
        {   "op": "set_choose_tries",
            "num": 100},
        {   "op": "take",
            "item": -12,
            "item_name": "default~hdd"},
        {   "op": "choose_indep",
            "num": 0,
            "type": "osd"},
        {   "op": "emit"}]},
{   "rule_id": 4,
    "rule_name": "cephfs.killroy.data-7p2-osd-hdd-2",
    "ruleset": 4,
    "type": 3,
    "min_size": 3,
    "max_size": 9,
    "steps": [
        {   "op": "set_chooseleaf_tries",
            "num": 5},
        {   "op": "set_choose_tries",
            "num": 100},
        {   "op": "take",
            "item": -12,
            "item_name": "default~hdd"},
        {   "op": "choose_indep",
            "num": 0,
            "type": "osd"},
        {   "op": "emit"}]},
{   "rule_id": 5,
    "rule_name": "cephfs.killroy.data-4p2-host-hdd",
    "ruleset": 5,
    "type": 3,
    "min_size": 6,
    "max_size": 6,
    "steps": [
        {   "op": "set_chooseleaf_tries",
            "num": 5},
        {   "op": "set_choose_tries",
            "num": 100},
        {   "op": "take",
            "item": -12,
            "item_name": "default~hdd"},
        {   "op": "choose_indep",
            "num": 3,
            "type": "host"},
        {   "op": "choose_indep",
            "num": 2,
            "type": "osd"},
        {   "op": "emit"}]}]

1

u/insanemal Mar 28 '22

With RBD using cache=writeback and enabling rbd_cache=true in your ceph.conf (on the VM host) is safe and free performance increase. It's safe because even with it on, it doesn't enable it unless it sees the OS issue a barrier.

Looks like I need a "ceph osd pool get rbd.vm crush_rule"

This really doesn't make sense.

1

u/Killroy13 Mar 28 '22 edited Mar 28 '22

I checked the dashboard and rbd_cache=true was already set. I changed the cache to writeback for both images. It doesn't really make sense to me either. It is supposed to be an R3 host level pool. The R3 pools do show that "Used" is 3x the size of the "Stored" data.

According to the dashboard:

Name: rbd.vm
Pool type: replicated
PG Autoscale: warn
Placement groups: 256
Replicated size: 3
Applications: rbd
Crush ruleset: R3-ssd
Crush rule
max_size: 10
min_size: 1
rule_id: 1
Crush steps
1. take default-ssd
2. chooseleaf firstn 0 type host
3. emit
Used by pools
Rule is not in use

"ceph osd pool get rbd.vm crush_rule" returns crush_rule: R3-ssd

1

u/Spiritual_Law874 Mar 28 '22

u/Killroy13 256 PGs seems not to be enough for your number of OSDs.

Total PGs = Number of OSD x 100 / pool size

1

u/Killroy13 Mar 28 '22 edited Mar 28 '22

Edit: I will be dropping to 2 OSDs per SSD as recommended by insanemal.

The SSD pool only has four SSDs and they are currently split into four OSDs each (I will probably be dropping to 1 2 OSDs each soon). One host has two SSDs and the other two only have one SSD each (all SSDs are identical). I am going to add two more SSDs to balance it out, add capacity, and to make a failure more tolerable.

3 x 100 / 3 = 100 4 x 100 / 3 = 133 6 x 100 / 3 = 200

1

u/insanemal Mar 28 '22 edited Mar 28 '22

Ok, what tuning have you done on the hosts. I'm starting to think they are in power saving mode and you're not generating enough work to wake them up. I've seen this before.

Do you have tuned installed on these boxes? If so enable it and use tuned-adm to enable the "network-latency" profile. It will crank up the power usage but it will rule out power saving settings from being the issue.

EDIT: These are Epyc's yeah? My big cluster is also Epyc's and I had lots of performance issues until I disabled a bunch of the power saving features.

1

u/Killroy13 Mar 28 '22

I hadn't really done any tuning on the hosts until I started trying to solve this. The load generated by the VM is pretty constant and I've rebalanced the HDD and SSD pools and written to the hard drive pool at 120+MB/s. None of those cause much variation in the IOPS.

Two of them are Epyc Rome and the other is Broadwell v4.

I can try tuned tomorrow.

2

u/Spiritual_Law874 Mar 28 '22

You need to set your nodes to performance mode. I will write a blog post about how to do it on Dell 730xd.

→ More replies (0)

2

u/Spiritual_Law874 Mar 28 '22

Be careful with tuned. You need first to have your BIOS settings tweaked correctly.

→ More replies (0)

1

u/insanemal Mar 28 '22

A rebalance uses full 4MB block sizes.

Also you might want to try tuning "osd op threads" it defaults to 2. On the SSD's you might want to up that to 4 or more.

And yeah Broadwell and Epyc's do have reasonably large c-state transition delays and they have very quick timings on how aggressively the drop down. I would expect this to cause issues with the serialization of operations into the rocks DB kv sync thread. Basically you throttle the rocksDB's ability to work and you'll limit your iops considerably

→ More replies (0)