Vercel Cron and Edge Function timeout issue
Unanswered
Juniper Titmouse posted this in #help-forum
Juniper TitmouseOP
We have a cron job in our system which triggers an API, initiating a function. This function iteratively makes a substantial number of API requests, often in excess of 100. All api routes are edge functions.
These requests subsequently initiate edge functions, resulting in further requests, and eventually leading to updates in our MySQL database.
Under asynchronous operation, this entire process would typically exceed 25 seconds. When run synchronously, the calls originating from the initial loop cease after 25 seconds. This is perplexing because the loop should have instructed all 100+ edge functions to initiate, regardless of whether the initial cron job has concluded. The result of the cron is we get about half of the data we expect to get before it gives up on the initial list.
The puzzling part is why the calls cease after the 25-second mark, even though they should technically operate independently of the initial cron job's lifecycle. Could you help shed light on this?"
These requests subsequently initiate edge functions, resulting in further requests, and eventually leading to updates in our MySQL database.
Under asynchronous operation, this entire process would typically exceed 25 seconds. When run synchronously, the calls originating from the initial loop cease after 25 seconds. This is perplexing because the loop should have instructed all 100+ edge functions to initiate, regardless of whether the initial cron job has concluded. The result of the cron is we get about half of the data we expect to get before it gives up on the initial list.
The puzzling part is why the calls cease after the 25-second mark, even though they should technically operate independently of the initial cron job's lifecycle. Could you help shed light on this?"
3 Replies
@Juniper Titmouse my hunch is, from 504 error, Gateway Timeout error, implys that Vercel GW (AWS k8s) fails to connect to Cloudflare worker. I am not pretty sure but there is a cap on max number of concurrent CF workers that Vercel GW can create, per user or all users.
@tafutada777 <@509480286485217280> my hunch is, from 504 error, Gateway Timeout error, implys that Vercel GW (AWS k8s) fails to connect to Cloudflare worker. I am not pretty sure but there is a cap on max number of concurrent CF workers that Vercel GW can create, per user or all users.
Juniper TitmouseOP
Do you know what the max concurrent CF worker is?
no i googled it but no luck