Hi, I've post a performance problem that i already have: https://stackoverflow.com/questions/7914971
Hi, I've post a performance problem that i already have: https://stackoverflow.com/questions/79149715/cloudflare-queues-with-slow-consumer-issues
Stack Overflow
Cloudflare queues with slow consumer issues
I'm having problems with my Cloudflare queue consumers. Despite using the different configuration options: (max_batch_timeout=0, max_batch_size=1, delaySeconds=0), my workers take between 5 and 10
14 Replies
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Is there a way to consume/product queues locally when using Vite as well? I've tried having
vite
and wrangler dev
running alongside each other but that doesn't seem to workYou should be able to push into a Queue, assuming your framework supports it
But not consume
when running locally i proxy the push to the queue worker's fetch which pushes to its local queue to then also consume
Do you have an example of this?
Yea, I can push to it but I'm looking to consume it as well. At the moment I'm setting up a 2nd worker and using a service binding which just feels cumbersome
my main app is a pages project, and i have a separate worker for consuming the queue, on the qworker, i have a fetch which accepts the same payload as the queue send. if the origin worker is the same as the consumer worker, the queue works as expected locally, i only send to the fetch if my env is local, otherwise my pages app sends directly to the queue
Wait, so are you using a framework in Vite?
Or...
Yea, remix
That is not currently possible, for dev anyway
The Frameworks team is working on a way to allow Vite-based dev servers to run in
workerd
, which would also allow them to expose non-HTTP event handlers(like Queues)I thought as much. I imagine that's this: https://github.com/flarelabs-net/vite-plugin-cloudflare. If so, can't wait for it!
Queue wrangler dev concurrency is 1 right?
does someone have a code example with pull consumers?
is there a way with which i could limit the processing rate of a queue besides with concurrency + batch size? like i want to limit a certain number of messages / h
actually nvm i can do this with D1 and a queue table (even though kinda dumb, it works tho)
u can using pull style consumer