Project

General

Profile

Actions

Bug #15225

closed

Linking to -lrbd causes process startup times to balloon

Added by Jason Dillaman about 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

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

Description

Take a trivial program:

$ cat test.c 
#include <stdlib.h>
int main () { exit (0); }

and compare the startup time with and without linking to -lrados -lrbd.

Without:

$ gcc test.c -o test
$ TIMEFORMAT='%R' ; time ./test
0.001

With:

$ gcc test.c -o test -lrbd
$ TIMEFORMAT='%R' ; time ./test
0.044

This really matters - currently initializing librbd consumes
15% of the total time taken to start up the libguestfs appliance.

I looked at the code and did some profiling with perf [see attachment]
and it seems as if the following code is responsible:

https://github.com/ceph/ceph/blob/master/src/common/Cycles.cc#L50

This code is really wrong, but it in lieu of being able to fix it,
it would be nice at least to have an environment variable we can
use to skip the madness.


Files

perf-report.txt (31.1 KB) perf-report.txt Richard Jones, 03/21/2016 02:11 PM
0001-Do-not-initialize-Cycles-globally.patch (3.52 KB) 0001-Do-not-initialize-Cycles-globally.patch Richard Jones, 03/21/2016 02:32 PM

Related issues 2 (0 open2 closed)

Copied to rbd - Backport #15359: infernalis: Linking to -lrbd causes process startup times to balloonRejectedActions
Copied to rbd - Backport #15360: hammer: Linking to -lrbd causes process startup times to balloonResolvedWei-Chung ChengActions
Actions

Also available in: Atom PDF