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

Pooling #76

Open
Tracked by #15
slinkydeveloper opened this issue Feb 6, 2023 · 4 comments
Open
Tracked by #15

Pooling #76

slinkydeveloper opened this issue Feb 6, 2023 · 4 comments
Labels

Comments

@slinkydeveloper
Copy link
Contributor

slinkydeveloper commented Feb 6, 2023

The goal of this issue is to implement connection pooling within the invoker. Probably depends on #96

@slinkydeveloper slinkydeveloper mentioned this issue Feb 6, 2023
@slinkydeveloper slinkydeveloper added needs-refinement Issues that need further investigation invoker labels Feb 6, 2023
@slinkydeveloper
Copy link
Contributor Author

Requirements for the pool (ordered by priority):

  • Reuse TCP/TLS connections across invocations
  • Be able to always provide quota for a new invocation, eventually opening a new tcp connection when the http2 max concurrent streams is exhausted. This is required to avoid logical deadlocks!
  • For use cases where no load balancing exists at L7, provide a tunable load balancing policy to decide whether to reuse an existing tcp connection or open a new one
  • When possible, hit the endpoint that previously served service id to allow state caching

Non-requirements:

  • Support HTTP/1

@slinkydeveloper
Copy link
Contributor Author

slinkydeveloper commented Mar 21, 2023

Different network deployments to support:

  • Protocol is in request/response mode and there is an API gateway/L7 load balancer between restate and the service. This is in particular the case of AWS Lambda
  • Protocol is in bidi-stream mode and there is an API gateway/L7 load balancer between restate and the service. Example load balancers are Envoy/Linkerd
  • Vanilla Kubernetes direct pod to pod communication with a vanila Service deployment. This can be either L4 load balancing with vIPs or DNS.

@tillrohrmann tillrohrmann added this to the 1A milestone Mar 21, 2023
@slinkydeveloper
Copy link
Contributor Author

slinkydeveloper commented Apr 14, 2023

Now that #237 is in place, we could implement a simple pooling strategy by sharing the hyper::Client among invocation tasks. This is still problematic with vanilla kubernetes pods (only L4 load balancing), and can still block when the max-streams is reached (as no new connections are opened when quota is reached), but the suspension timeout guarantees that after a while stream quotas are released for invocations waiting for very long time on completions.

@slinkydeveloper
Copy link
Contributor Author

I've opened #293 with the simple pooling strategy that shares the hyper::Client. Let's keep this issue open though, as I think #293 is only a temporary solution but not the long term strategy.

slinkydeveloper added a commit that referenced this issue Apr 18, 2023
@slinkydeveloper slinkydeveloper removed the needs-refinement Issues that need further investigation label Apr 21, 2023
@slinkydeveloper slinkydeveloper removed this from the 1A milestone Jun 21, 2023
slinkydeveloper added a commit to slinkydeveloper/restate that referenced this issue Mar 21, 2024
…8d559..61ae44b2

61ae44b2 Update documentation on error codes (restatedev#77)
576a1b26 Add HandlerType. Fix restatedev#1092 (restatedev#76)
0624d092 Payload schema for input and output. This provides basic format awareness. (restatedev#74)

git-subtree-dir: crates/service-protocol/service-protocol
git-subtree-split: 61ae44b2175c2a54c2d7a138a3368df17f389ebb
slinkydeveloper added a commit to slinkydeveloper/restate that referenced this issue Mar 26, 2024
…8d559..29b28f98

29b28f98 Modify Input/Output schema in deployment_manifest_schema.json (restatedev#80)
26d91e69 Replace protocol Empty message with custom one, so we remove the dependency on protobuf built-in messages (restatedev#79)
61ae44b2 Update documentation on error codes (restatedev#77)
576a1b26 Add HandlerType. Fix restatedev#1092 (restatedev#76)
0624d092 Payload schema for input and output. This provides basic format awareness. (restatedev#74)

git-subtree-dir: crates/service-protocol/service-protocol
git-subtree-split: 29b28f9867734bc01dd47c4666d9d56c90b626f5
slinkydeveloper added a commit to slinkydeveloper/restate that referenced this issue Mar 26, 2024
…8d559..29b28f98

29b28f98 Modify Input/Output schema in deployment_manifest_schema.json (restatedev#80)
26d91e69 Replace protocol Empty message with custom one, so we remove the dependency on protobuf built-in messages (restatedev#79)
61ae44b2 Update documentation on error codes (restatedev#77)
576a1b26 Add HandlerType. Fix restatedev#1092 (restatedev#76)
0624d092 Payload schema for input and output. This provides basic format awareness. (restatedev#74)

git-subtree-dir: crates/service-protocol/service-protocol
git-subtree-split: 29b28f9867734bc01dd47c4666d9d56c90b626f5
slinkydeveloper added a commit that referenced this issue Mar 26, 2024
…8d559..29b28f98

29b28f98 Modify Input/Output schema in deployment_manifest_schema.json (#80)
26d91e69 Replace protocol Empty message with custom one, so we remove the dependency on protobuf built-in messages (#79)
61ae44b2 Update documentation on error codes (#77)
576a1b26 Add HandlerType. Fix #1092 (#76)
0624d092 Payload schema for input and output. This provides basic format awareness. (#74)

git-subtree-dir: crates/service-protocol/service-protocol
git-subtree-split: 29b28f9867734bc01dd47c4666d9d56c90b626f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants