xintercept
xintercept
CDCloudflare Developers
Created by xintercept on 2/27/2024 in #workers-help
Websockets, Durable Objects & Subrequest Limits
Hey folks, I'm trying to design an application on Workers that involves long-lived Websockets. I want to proxy the websocket to another service (hosted off of CF) and I want to forward a copy of all the messages that go over the socket a Queue. I have this working, but I run into subrequests limits with the Queue writes. After 1k message have been sent over the socket, we need to tear-down and re-establish the session be able to keep writing to the queue. I'm thinking it may be possible to forward to the messages to a Durable Object (over a single websocket) and publish to the queue from there, but I'm not sure what subrequest limits would apply in this case. Any idea if this would work? Or if there's another way of going about this?
2 replies
CDCloudflare Developers
Created by xintercept on 1/29/2024 in #workers-help
How to know when subrequest limit is hit?
We have some long-lived (always on) websockets terminating on our worker, and it appears we lose communication to the outside world after some time. We were initially making HTTP calls out during the request. We've since moved that sending messages to a queue, and handling these with another worker. No change in behaviour though. I suspect we're coming across subrequest limits. And it looks like calls to internal services are limited too (albeit with a higher limit). How would I able to confirm that the subrequest limit was hit for a particular request? Is there a way to detect this while the worker is running?
2 replies