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 User2mo ago
Message Not Public
Sign In & Join Server To View
DanGamble
DanGamble2mo 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
Ahz2mo 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
DanGamble2mo 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
Ahz2mo 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
DanGamble2mo 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
DanGamble2mo 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
DoggeSlapper2mo ago
Queue wrangler dev concurrency is 1 right?
Baltazar
Baltazar2mo ago
does someone have a code example with pull consumers?
oof2win2
oof2win22mo 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
DoggeSlapper2mo ago
u can using pull style consumer
Want results from more Discord servers?
Add your server