Project

General

Profile

Actions

Bug #53747

open

Ceph subprocess calling calls close() 1 million times

Added by Niklas Hambuechen over 2 years ago. Updated about 2 years ago.

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

0%

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

Description

When you run a command that spawns an external program, like `ceph device scrape-health-metrics`, Ceph calls the `close()` syscall 1 million times, as evidenced by strace:

[pid 62944] close(987786) = -1 EBADF (Bad file descriptor)
[pid 62944] close(987787) = -1 EBADF (Bad file descriptor)

This is slow, and makes stracing for debugging a pain.

Today are now more efficient ways to close file descriptors before exec()ing:

1. `O_CLOEXEC` when opening any file. Some ecosystems, like Python, use this throughout. This is the most efficient.
2. The close_range() system call, introduced with Linux 5.9: https://man7.org/linux/man-pages/man2/close_range.2.html - Motivation: https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.9-Close-Range

Actions #1

Updated by Guillaume Abrioux about 2 years ago

  • Project changed from ceph-volume to mgr
Actions

Also available in: Atom PDF