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.

Further timeouts and resource limiting.

See original GitHub issue
  • --timeout-request-start (Timeout unless request headers complete within this time. ~10s)
  • --timeout-request-complete (Timeout if request body is still being read after this time. ~60s)
  • ~–limit-request-line-size (4096, See gunicorn)~
  • ~–limit-request-header-size (8190, See gunicorn)~
  • ~–limit-request-header-count (100, See gunicorn)~
  • --limit-ws-message-size

@Kludex notes

  • We are not going to implement --limit-request-header-count. The header size limitation is enough.
  • Should we consider timeout on startup and shutdown lifespans?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Kludexcommented, Oct 2, 2022

I think --limit-request-header-size can be considered equivalent to h11-max-incomplete-event-size in the h11 implementation, which we already have.

EDIT: Actually, the h11-max-incomplete-event-size is a replacement for both --limit-request-header-size and --limit-request-line-size:

max_incomplete_event_size (int) – The maximum number of bytes we’re willing to buffer of an incomplete event. In practice this mostly sets a limit on the maximum size of the request/response line + headers. If this is exceeded, then next_event() will raise RemoteProtocolError.

Ref.: https://h11.readthedocs.io/en/latest/api.html#h11.Connection

1reaction
hoopescommented, Jan 4, 2020

Hello,

Apologies for chiming in on this, but my use case could really use this feature. I have a very large sql query that uses sqlalchemy (so it is not async, from the start). This is an internal “big data” app, so there is no pressure for super low latency per request. I’m streaming lines of json with a starlette StreamingResponse from a fastapi application.

However, the query takes about 90-120 seconds to get started actually producing results. uvicorn appears to time out, whether i run it directly or under gunicorn. daphne has a timeout arg, so i’m using that now. I’d really like to use uvicorn as a work in gunicorn, to get easy multi-process service.

Anyway, I just wanted to bump this. If you pointed me to the code where the timeout actually occurs, I might be interested in trying a PR, if you’d be interested (at least for the request start, and the others if they fall out easily).

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tuning Resource Limits - GeoServer Training - GeoSolutions
Resource limits are settings to be configured for individual OGC services to ... for more than 2 or 3 seconds for a WMS...
Read more >
Error message when you execute a linked server query in ...
Execution terminated by the provider because a resource limit was reached. ... section of this article for further details about the timeout options....
Read more >
How to fix: Lack of resources and Rate Limiting - Strike Security
Checklist to know if your API is vulnerable: Missing execution timeouts limits. Missing max allocable memory limits. Missing number of file descriptors limits....
Read more >
How to Fix the 504 Gateway Timeout Error on Your Site - Kinsta
You can edit your server config files to increase resource limits for specific directives. This can help you resolve the 504 Gateway Timeout...
Read more >
Limiting time and memory consumption of a program in Linux
Without further ado, the 14 kilobyte standalone Perl script that limits a ... most Linux systems can be found at pshved/timeout GitHub project....
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