Workers API responding very slow (>2 seconds for simple APIs, >20s for others)
I deployed a CF worker binded with a D1 database.
I know about the cold start delay, but all my APIs are taking approx. 2 second each.
I have an API to fetch 150 product data. That takes 20+ seconds. I optimized it to use batch queries and everything. I did EXPLAIN QUERY and the query itself takes 20ms.
The worker colo is "SIN" and D1 is in "APAC".
To me, this looks like a worker issue than a D1 issue as D1 query analysis says all good.
Would be grateful if somebody could help me out.

1 Reply
I optimized it to use batch queries and everything. I did EXPLAIN QUERY and the query itself takes 20ms.Batch execution returns a list of results, if you add up all of the durations, it's 20ms combined, or 20ms per? any more info you could share would be helpful. If it's open source, the repo, or the website url to test against, etc