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

Large content in info response impacts performance a lot #234

Closed
trallnag opened this issue Mar 18, 2023 · 1 comment · Fixed by #238
Closed

Large content in info response impacts performance a lot #234

trallnag opened this issue Mar 18, 2023 · 1 comment · Fixed by #238

Comments

@trallnag
Copy link
Owner

trallnag commented Mar 18, 2023

Raised by @bbeattie-phxlabs.

Collection of body content doesn't matter much when the response size is under a few megs, but when a response is a FileResponse beyond a couple hundred megs, it really starts to matter.

Considering response.body isn't used in any metrics in metrics.py, I'd suggest removing its collection altogether.

Hmm... I see this was added in for #203. I wonder if the better approach here would be to customize the send_wrapper based on a PrometheusInstrumentatorMiddleware instance variable, allowing this body aggregation for those that choose to enable it, or disabled for those that choose to disable it, depending on the approach.

@trallnag
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment