Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider the performance harm of synchronized exporters #1238

Closed
taozhijiang opened this issue Mar 1, 2022 · 3 comments
Closed

Consider the performance harm of synchronized exporters #1238

taozhijiang opened this issue Mar 1, 2022 · 3 comments

Comments

@taozhijiang
Copy link
Contributor

Hi, I have tested and deployed the latest v1.2.0 C++ SDK in our production environments. Our cloud infrastructure provider supports HTTP OTLP exporter for the Tracer function.

I set the sample_ratio to 0.01, otherwise the Tracer will greately affect our service performance. However, when analyse the tracer data detailly, we find some slow handled requests, and most time are token by span->End() call actually.

Span::End() -> MultiSpanProcessor::OnEnd() -> SimpleSpanProcessor::OnEnd()

We can see, SimpleSpanProcessor::End() calls exporter with SpinLockMutex, and will call OtlpHttpExporter with http request and wait for the response synchronously. At this time, our business main procedure will hang for these operations.
I think http requests are inefficient and slow. So the export operation should better be executed by additional threads asynchronously, I known create additional theads in SDK is not a very graceful idea, so hope for better solutions here.

@esigo
Copy link
Member

esigo commented Mar 1, 2022

Hi @taozhijiang, thanks to reaching out to us. There is already a PR (#1209) by @owent under review.

@lalitb
Copy link
Member

lalitb commented Mar 1, 2022

Also to add, @taozhijiang - did you consider using BatchSpanProcessor, as this performs upload in a separate thread, and so allows the application to continue with business logic without waiting for the upload to complete.

@taozhijiang
Copy link
Contributor Author

Also to add, @taozhijiang - did you consider using BatchSpanProcessor, as this performs upload in a separate thread, and so allows the application to continue with business logic without waiting for the upload to complete.

Thanks for the suggestion, I will try this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants