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

octopus: rgw: Use 100-continue in OPA requests to reduce latency #44950

Open
wants to merge 1 commit into
base: octopus
Choose a base branch
from

Conversation

BenoitKnecht
Copy link
Contributor

backport tracker: https://tracker.ceph.com/issues/52242


backport of #42685
parent tracker: https://tracker.ceph.com/issues/52067

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/master/src/script/ceph-backport.sh

When we send a POST request to Open Policy Agent, we send the headers first,
wait for TCP ACK from the server, and then send the body. But due to [delayed
ACK], the TCP ACK can be delayed by up to 500 ms (but typically 40 ms on
Linux), which in this case is huge as OPA typically takes only 1 ms to process
a request.

This commit adds the

```
Expect: 100-continue
```

header to the `POST` requests sent to OPA, which makes the server reply with

```
HTTP/1.1 100 Continue
```

immediately after receiving the headers, thereby avoiding the 40 ms delay.

[delayed ACK]: https://en.wikipedia.org/wiki/TCP_delayed_acknowledgment

Fixes: https://tracker.ceph.com/issues/52067
Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 871d180)
@github-actions github-actions bot added this to the octopus milestone Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant