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
Fixing #779 by settings http protocol and allowing to set keep alive … #780
Conversation
guillotina/_settings.py
Outdated
@@ -91,5 +91,7 @@ | |||
"search_parser": "default", | |||
"object_reader": "guillotina.db.reader.reader", | |||
"thread_pool_workers": 32, | |||
"keep_alive": 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 is very low and I'm not sure it'll actually help the situation if this is the same problem that I've seen.
fwiw, nginx defaults to 75sec keep alive I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default keep alive timeout at uvicorn is 5 (https://github.com/encode/uvicorn/blob/master/uvicorn/config.py#L134)
guillotina/_settings.py
Outdated
@@ -91,5 +91,7 @@ | |||
"search_parser": "default", | |||
"object_reader": "guillotina.db.reader.reader", | |||
"thread_pool_workers": 32, | |||
"keep_alive": 5, | |||
"http_protocol": "h11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a shame we end up with h11 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its temporal until encode/uvicorn#344 is fixed
I'm not sure if we want to expose all these options in the cli / app_settings in the top level. I'd suggest something like: app_settings = {
"server_settings": {
"uvicorn": { ... }
}
} that is mapped to the uvicorn Config (pseudo-code): uvicorn.Config(**app_settings["server_settings"]["uvicorn"]) |
Codecov Report
@@ Coverage Diff @@
## master #780 +/- ##
========================================
Coverage ? 94%
========================================
Files ? 308
Lines ? 27619
Branches ? 0
========================================
Hits ? 25937
Misses ? 1682
Partials ? 0
|
…timeout