Connection limits#3552
Conversation
What issues did you run into there? I'm happy to start working on any changes needed. |
|
@dicej you can see code plus a print out of the compilation errors in this commit. Essentially there's no way to make the |
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
…nces Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
…it times Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Signed-off-by: Ryan Levick <rlevick@akamai.com>
Thanks, I'll check out that commit and play around with it. |
Update: thanks to @dicej and @alexcrichton for helping figure this out. With the addition of bytecodealliance/wasmtime#13549, we will be able to support this. The code for that can be see in https://github.com/dicej/spin/tree/connection-limits. We'll want to wait until the linked changes land in a release of wasmtime to adopt this, but the path forward is now clear. |
|
Do we have an issue tracking p3 socket support? |
I do not see any. |
This PR is probably best reviewed commit by commit. Each factor's changes are largely independent and follow the same pattern.
This adds connection limits (both per factor and global) for the following factors (which originally had separate PRs which have been closed in favor of a single PR):
Additionally the global connection limit is connected to the existing outbound http connection limiting introduced in #3285. The runtime config toml has also been updated to be consistent across all factors while retaining the now deprecated existing toml naming for backwards compatibility.
Open Issues/Questions
ConnectionSemaphore. I may need to talk with @dicej about introducing changes inwasmtime-wasito allow this..awaitfor quote blocking the guest from making progress. Should we always immediately error so that guests can decide what to do when no capacity is available? We treated sockets differently because waiting would risk deadlock if a component holds sockets open across async yield points.Breaking changes
This does contain one breaking change (beyond factor APIs which I believe we do not have any stability guarantees at this point): the
outbound_http.concurrent_connection_permits_acquiredmetric has been renamed tooutbound_connection_permits_acquiredwith the labelkindset tooutbound_http. Maintaining backward compatibility here is ugly but doable if we believe it is important.