question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sentry has ~8% overhead in Django test suites

See original GitHub issue

Apologies for a somewhat vague report, I’m happy to expand this once it’s decided what the appropriate course of action is.

We’ve found that disabling Sentry (not calling init) in tests saves around 8% of test time on a large Django codebase. This result has been replicated by an engineer at another company with a different Django codebase.

It could be that this is just the expected overhead, in which case I think documenting this would be great. Some advice or comment in that documentation around whether this is worth it would be great as well – is it worth 8% to ensure that Sentry doesn’t interact badly with the rest of the codebase, or is Sentry reliable and isolated enough that it’s unlikely to catch any issues and the 8% time saving is more important.

I wouldn’t be surprised if the overhead is not expected in typical production use, and that tests are a weird case (they throw a lot of handled exceptions for example).

Alternatively, it could be that this overhead is not expected and that this is a performance issue that Sentry would like to address. If so I’m happy to provide data from our test suite if you can point me towards what would be useful for you.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
sl0thentr0pycommented, Dec 20, 2021

Updating this old thread. We now have a benchmark repository where we compare the overhead from a normal django app, one instrumented with Sentry and one instrumented with OpenTelemetry. There is also a related video explaining the setup and some numbers.

There is no official collection of numbers yet but I can update this thread again when we do.

1reaction
untitakercommented, Oct 19, 2020

Thanks @ChillarAnand that confirms the suspicion. I hope we can free resources internally to work on this.

Also, is there a way to estimate the approximate overhead of sentry profiling in production projects?

this generally depends on the kind of web framework and what kind of extensions you are using – 8% is definetly on the upper end, also because we hook into a lot of Django. Integrations for AIOHTTP, Sanic and Flask capture much less data and as such the overhead will be lower. However, if you install a lot of Flask extensions you may get close to the same overhead as Django.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find Performance Issues In Web Apps with Sentry | Avil Page
Depending on the traffic, server capacity, acceptable overhead, we can decide what percentage of the requests we need to trace. Once performance ...
Read more >
How we run our Python tests in hundreds of environments ...
Tox is the tool we use to run our test suite in different environments. We use good old make for running our test...
Read more >
Disable Instrumentation Packages during Tests - Adam Johnson
The overhead for all this instrumentation is normally significant. For example, on a couple of project's test suites, I've seen Sentry add ...
Read more >
Dan Palmer on Twitter: "Have spent some time optimising a Django ...
Have spent some time optimising a Django test suite to run faster. Here are a few details… Situation: - 10k tests - ~40%...
Read more >
Sentry Documentation - Read the Docs
cases, Sentry provides tight integrated with several large social ... Note: We use py.test for the Python test suite, and a combination of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found