Skip to contentSkip to conversation

Investigate busy ceph-msgr worker thread

DISCUSSION Stefan Kooman 2 participants 4 messages Dec 3, 2020 – Dec 4, 2020

lore
Share & tools
lore
#0 lore raw

Hi,

We have a cephfs linux kernel (5.4.0-53-generic) workload (rsync) that seems to be limited by a single ceph-msgr thread (doing close to 100% cpu). We would like to investigate what this thread is so busy with. What would be the easiest way to do this? On a related note: what would be the best way to scale cephfs client performance for a single process (if at all possible)?

Thanks for any pointers.

Gr. Stefan

#1 lore raw
Quoted 11 lines · Stefan Kooman

Hi,

We have a cephfs linux kernel (5.4.0-53-generic) workload (rsync) that seems to be limited by a single ceph-msgr thread (doing close to 100% cpu). We would like to investigate what this thread is so busy with. What would be the easiest way to do this? On a related note: what would be the best way to scale cephfs client performance for a single process (if at all possible)?

Thanks for any pointers.

Usually kernel profiling (a'la perf) is the way to go about this. You may want to consider trying more recent kernels and see if they fare any better. With a new enough MDS and kernel, you can try enabling async creates as well, and see whether that helps performance any.

As far as optimizing for a single process, there's not a lot you can do, really.

Signature · 1 line
Jeff Layton <[email protected]>
#2 lore raw
Quoted 10 lines · Jeff Layton
Quoted 9 lines · Stefan Kooman

Hi,

We have a cephfs linux kernel (5.4.0-53-generic) workload (rsync) that seems to be limited by a single ceph-msgr thread (doing close to 100% cpu). We would like to investigate what this thread is so busy with. What would be the easiest way to do this? On a related note: what would be the best way to scale cephfs client performance for a single process (if at all possible)?

Quoted 7 lines
Quoted 2 lines

Thanks for any pointers.

Usually kernel profiling (a'la perf) is the way to go about this. You may want to consider trying more recent kernels and see if they fare any better. With a new enough MDS and kernel, you can try enabling async creates as well, and see whether that helps performance any.

The thread is mostly busy with "build_snap_context":

+ 94.39% 94.23% kworker/4:1-cep [kernel.kallsyms] [k] build_snap_context

Do I understand correctly if this code is checking for any potential snapshots? As grepping through linux cephfs code gives a hit on snap.c

Our cephfs filesystem has been created in Luminous, and upgraded through Mimic to Nautilus. We have never enabled snapshot support (ceph fs set cephfs allow_new_snaps true). But the filesystem does seem to support it (.snap dirs present). The data rsync is processing does contain a lot of directories. It might explain the amount of time spent in this code path.

Would this be a plausible explanation?

Thanks,

Stefan

#3 lore raw
Quoted 34 lines · Stefan Kooman
Quoted 10 lines · Jeff Layton
Quoted 9 lines · Stefan Kooman

Hi,

We have a cephfs linux kernel (5.4.0-53-generic) workload (rsync) that seems to be limited by a single ceph-msgr thread (doing close to 100% cpu). We would like to investigate what this thread is so busy with. What would be the easiest way to do this? On a related note: what would be the best way to scale cephfs client performance for a single process (if at all possible)?

Quoted 7 lines
Quoted 2 lines

Thanks for any pointers.

Usually kernel profiling (a'la perf) is the way to go about this. You may want to consider trying more recent kernels and see if they fare any better. With a new enough MDS and kernel, you can try enabling async creates as well, and see whether that helps performance any.

The thread is mostly busy with "build_snap_context":

+ 94.39% 94.23% kworker/4:1-cep [kernel.kallsyms] [k]
build_snap_context

Do I understand correctly if this code is checking for any potential snapshots? As grepping through linux cephfs code gives a hit on snap.c

Our cephfs filesystem has been created in Luminous, and upgraded through Mimic to Nautilus. We have never enabled snapshot support (ceph fs set cephfs allow_new_snaps true). But the filesystem does seem to support it (.snap dirs present). The data rsync is processing does contain a lot of directories. It might explain the amount of time spent in this code path.

Quoted 5 lines

Would this be a plausible explanation?

Thanks,

Stefan

Yes, that sounds plausible. You probably want to stop rsync from recursing down into .snap/ directories altogether if you have it doing that.

Signature · 1 line
Jeff Layton <[email protected]>