-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: use DuplexStream
instead of UnixStream
to communicate with workers
#320
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note: Please keep a close eye on stage infra to ensure that there are no runtime issues after merging this PR. (But I don't expect any issues.) |
@nyannyacha Can you prefix this PR as a |
nyannyacha
changed the title
perf: use
feat: use Apr 19, 2024
DuplexStream
instead of UnixStream
to communicate with workersDuplexStream
instead of UnixStream
to communicate with workers
laktek
approved these changes
Apr 19, 2024
🎉 This PR is included in version 1.44.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
nyannyacha
added a commit
to nyannyacha/edge-runtime
that referenced
this pull request
Apr 22, 2024
…te with workers (supabase#320)" This reverts commit 4e53e2a. # Conflicts: # crates/base/src/server.rs # crates/cli/src/main.rs
nyannyacha
added a commit
to nyannyacha/edge-runtime
that referenced
this pull request
Apr 22, 2024
…te with workers (supabase#320)" This reverts commit 4e53e2a. # Conflicts: # crates/base/src/server.rs # crates/cli/src/main.rs
nyannyacha
added a commit
to nyannyacha/edge-runtime
that referenced
this pull request
Apr 25, 2024
nyannyacha
added a commit
to nyannyacha/edge-runtime
that referenced
this pull request
May 2, 2024
nyannyacha
added a commit
to nyannyacha/edge-runtime
that referenced
this pull request
May 2, 2024
nyannyacha
added a commit
to nyannyacha/edge-runtime
that referenced
this pull request
May 6, 2024
nyannyacha
added a commit
that referenced
this pull request
May 7, 2024
* feat: reintroduce `DuplexStream` See #320 * stamp: add an example for chunked transfer encoding * fix: defer pipe closure timing * stamp: polishing * fix: original request body should be able to abort when a request to the user worker has been cancelled * stamp: adjust edge runtime arguments of `scripts/run.sh` * stamp(k6): add a scenario for upload failure due to exceeding max size * refactor: simplify the expression of connection lifetime using `CancellationToken` * fix: update feature flag for `base` crate * stamp: polishing * chore: update `Dockerfile` * chore: update file update examples * chore(base): update dependencies * chore: update `Cargo.lock` * stamp: update deno file update example * stamp: polishing * stamp: add an integration test for request failure during multipart uploading * stamp: don’t expose `Interrupted` error to outside * chore(sb_workers): update dependencies * chore: update `Cargo.lock` * fix: cleanup request body unconditionally * stamp: update oak file update example * fix: propagate user worker side error properly * stamp: cleanup tests codes and add more tests for file uploads * fix: prevent stack overflow when dropping `Stream2` * stamp: disambiguate local variable naming * stamp: polishing * stamp(k6): update a scenario * stamp: update an oak file upload example * stamp: update main service example
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Refactor
Description
This PR changes the stream type used to communicate between workers to
DuplexStream
instead ofUnixStream
to improve request throughput.It was tested on a local machine, so it's imprecise, but it showed an improvement of about 10% in request throughput per second.
List of arguments to be created due to the introduction of this PR
--tcp-nodelay
flag disables Nagle's algorithm. (Default istrue
)Figure1. UnixStream, Debug
Figure2. DuplexStream, Debug
Figure3. UnixStream, Release
Figure4. DuplexStream, Release
Figure5. DuplexStream, Debug (examples/chunked-text, TCP_NODELAY OFF)
Figure6. DuplexStream, Debug (examples/chunked-text, TCP_NODELAY ON)