Project

General

Profile

Actions

Bug #63814

open

File deletion is 20x slower on kernel mount compared to libcephfs

Added by Niklas Hambuechen 5 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
fs/ceph
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

I am trying to delete a directory that has 200k subdirs with 1000 files in each. So approximately 200M files.

Doing this on the kernel mount using `rm -r` is very slow, around 200 `unlink()`s per second according to strace.

However doing it with `libcephfs` is surprisingly 20x faster.

This ticket is for finding out why, and ideally making the kernel mount equally fast.

Details

  • Ceph 16.2.7, Linux kernel mount 6.1.51, x86_64
  • 3-node cluster, 10 spinning-disk bluestore OSDs each with DB on NVMe SSDs
  • CephFS metadata pool on NVMe SSD
  • Single-threaded `libcephfs` `unlink()` does around 2000 per second, 2-threaded (using Python's `ThreadPoolExecutor` does 4000 unlinks per second; more threads don't help
  • Trying to parallelise the kernel mount `rm -r` by deleting multiple dirs in parallel using `xargs` or GNU `parallel` does not provide any speedup
  • No other Ceph clients are interacted the dir on which the deletion is happening (they have the FS mounted but do not do operations on that dir).

What could be reasons that the kernel mount is so much slower?

Actions

Also available in: Atom PDF