Parallel accesses to a krbd block device
Dear all, We're running an HDD-backed Ceph cluster, which is currently facing long RADOS access latency, which we are investigating. These high latencies made what looks like a lack of parallelism in krbd visible. Our access patterns make it very likely that only a few of our many RBD-mapped images are accessed at any time, and that those few are accessed by many processes at once. I've boiled it down to a minimal example using dd, reading blocks of 100kB randomly located within the ~100GB rbd image: ``` time for _ in $(seq 1 20); do pos=$((40 * $RANDOM % 22500 + $RANDOM % 40)) dd if=/dev/rbdX bs=100k ibs=100k skip="$pos" count=1 of=/dev/null 2> /dev/null done ``` When running a single of those loops, it takes 2.5s to 4s. However, when running four of those same loops at once on the same /dev/rbdX, each takes 12-14s: roughly the time it would take to run four of those sequentially. If instead I map the same RBD image multiple times as /dev/rbdX1.../dev/rbdX4, and run a loop against each mapped device, parallelism is back and each takes again 2.5-4s. The dd-based example is the easier to communicate, but I also observed this behaviour within our usual accesses through Python, and reproduced it within a simple C binary. We are running Ceph 20.2.4 on Debian Bookworm (kernel 6.1.0-53). We are surprised by this behaviour, and did not find anything on the subject. Is this expected? If not, is there a known issue about this, or a common misconfiguration? We'd be grateful for any hint on this! Best regards, -- Théophile Bastian
participants (1)
-
Théophile Bastian