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

[bt#19748][ADD] server: allow env variable to control HTTP socket timeout #17143

Merged
merged 1 commit into from Jul 13, 2022

Conversation

BT-tbaechle
Copy link

@BT-tbaechle BT-tbaechle commented Jul 13, 2022

As indicated in the comment, it's much preferred to perform response
buffering at the reverse proxy level than to increase the socket
timeout. It will free up HTTP workers for other requests faster, while
the proxy does the work of buffering the stream on disk as needed.

/!\ The timeout is also used to protect from accidental DoS effects
in situations of low worker availability, due to idle connections
caused e.g. by wkhtmltopdf's connection pooling.
Setting a high timeout will make the protection less effective, so
ensuring you have enough free HTTP workers at all times becomes critical.

In our tests with nginx's defaut buffering on a typical hardware with
SSD storage, buffering up to 1GB responses did not require any change
of the socket timeout on the Odoo side, though your mileage may vary.
See also nginx's proxy_buffering and proxy_max_temp_file_size config
directives.

OPW-2247730
See also: #20158

closes odoo#51824

Signed-off-by: Olivier Dony (odo) odo@openerp.com
(cherry picked from commit d78ea12)

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Links to Odoo:

As indicated in the comment, it's much preferred to perform response
buffering at the reverse proxy level than to increase the socket
timeout. It will free up HTTP workers for other requests faster, while
the proxy does the work of buffering the stream on disk as needed.

/!\ The timeout is also used to protect from accidental DoS effects
in situations of low worker availability, due to idle connections
caused e.g. by wkhtmltopdf's connection pooling.
Setting a high timeout will make the protection less effective, so
ensuring you have enough free HTTP workers at all times becomes critical.

In our tests with nginx's defaut buffering on a typical hardware with
SSD storage, buffering up to 1GB responses did not require any change
of the socket timeout on the Odoo side, though your mileage may vary.
See also nginx's `proxy_buffering` and `proxy_max_temp_file_size` config
directives.

OPW-2247730
See also: #20158

closes odoo#51824

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
(cherry picked from commit d78ea12)
@BT-tbaechle BT-tbaechle changed the title [ADD] server: allow env variable to control HTTP socket timeout [bt#19748][ADD] server: allow env variable to control HTTP socket timeout Jul 13, 2022
@BT-tbaechle BT-tbaechle merged commit aabf787 into 10.0.project_th Jul 13, 2022
@BT-tbaechle BT-tbaechle deleted the 10.0.project_th.bt#19748 branch July 13, 2022 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants