Hi, I've post a performance problem that i already have: https://stackoverflow.com/questions/7914971

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
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
DanGamble
DanGamble3w ago
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 work
Hello, I’m Allie!
You should be able to push into a Queue, assuming your framework supports it But not consume
Ahz / Grimlor
Ahz / Grimlor2w ago
when running locally i proxy the push to the queue worker's fetch which pushes to its local queue to then also consume
DanGamble
DanGamble2w ago
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
Ahz / Grimlor
Ahz / Grimlor2w ago
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
Hello, I’m Allie!
Wait, so are you using a framework in Vite? Or...
DanGamble
DanGamble2w ago
Yea, remix
Hello, I’m Allie!
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)
DanGamble
DanGamble2w ago
I thought as much. I imagine that's this: https://github.com/flarelabs-net/vite-plugin-cloudflare. If so, can't wait for it!
DoggeSlapper
DoggeSlapper2w ago
Queue wrangler dev concurrency is 1 right?
Baltazar
Baltazar2w ago
does someone have a code example with pull consumers?
oof2win2
oof2win22w ago
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)
DoggeSlapper
DoggeSlapper2w ago
u can using pull style consumer
Want results from more Discord servers?
Add your server