and its still running out of cpu time

and its still running out of cpu time
16 Replies
Sid
Sid3y ago
And you're on the Unbound model?
Pato
PatoOP3y ago
yes
Sid
Sid3y ago
Hm, so if 3 users take about 30s, I'd try to do one user at a time first That sounds like the easiest thing to try
Pato
PatoOP3y ago
the thing is that Im running it on a cron and need to be run every month
Sid
Sid3y ago
BTW if you're on an ENT plan, it'd probably also be worth reaching out officially
Pato
PatoOP3y ago
how can i do that
Erisa
Erisa3y ago
If you mean how can you reach out officially, here: https://dash.cloudflare.com/?to=/:account/support
Pato
PatoOP3y ago
what i need to is, i have a list of ids, the using those ids i need to run some calculations (heavy) and then send an email\ even using batching, the worker runs out of cpu time thanks! can you help to white board really quick how could I do this? @Sid | R2
Sid
Sid3y ago
You'd really be better off doing this with a CSM if you're on an Enterprise plan. I just don't have all the pieces here.
Pato
PatoOP3y ago
i see, thanks!
kian
kian3y ago
Just to clarify, is it memory limits or CPU limits you’re hitting?
Pato
PatoOP3y ago
cpu limits i manage to pin point this problem to this
Error: Too many subrequests.
at checkedFetch (worker.js:60:23)
at getAccountStatementAll (worker.js:16395:30)
at sendAllClientsAccountStatement (worker.js:16434:29)
at handleSendAllClientsAccountStatement (worker.js:16496:15)
at async handle (worker.js:12065:33)
at async Object.handle (worker.js:12065:33) {
stack: Error: Too many subrequests.
at checkedFetch (…)
at async Object.handle (worker.js:12065:33),
message: Too many subrequests.
}
Error: Too many subrequests.
at checkedFetch (worker.js:60:23)
at getAccountStatementAll (worker.js:16395:30)
at sendAllClientsAccountStatement (worker.js:16434:29)
at handleSendAllClientsAccountStatement (worker.js:16496:15)
at async handle (worker.js:12065:33)
at async Object.handle (worker.js:12065:33) {
stack: Error: Too many subrequests.
at checkedFetch (…)
at async Object.handle (worker.js:12065:33),
message: Too many subrequests.
}
kian
kian3y ago
An Unbound Worker can make 1,000 subrequests per invocation
Pato
PatoOP3y ago
Yeah is probably making a lot more than that Is there a way to check exactly how many is it making? And how would be a way to work around this? I don’t think batching would help with subrequests right? Because its the same invocation
kian
kian3y ago
Use Service Bindings to invoke the Worker which will have a refreshed subrequest limit i.e have a Worker to get the IDs, and then it batches them & sends the batch of IDs to a Service Binding Worker that can process them
Pato
PatoOP3y ago
Ohh that’s perfect! And i guess i can have multiple workers that process this requests? Or is the same as batching them to a new worker?

Did you find this page helpful?