Workers limitations & error logs

I’ve built a (wasm) worker that resizes images (yes I know there’s a built-in version of that in business/enterprise version, but I don’t want to pay for that). Usually it’s working fine, however, sometimes it throws error 1102 with message “Worker exceeded resource limits”. It also says " you should login to Cloudflare and check the error logs for XXX"

So the question is;

  1. I tried to find the logs from Cloudflare but couldn’t find any. Where are those?
  2. What resource limit am I hitting? If I refresh the error page few times then it starts to work again.

1102 is most likely CPU in this case, I’ve seen it hit frequently when parsing XML or during hashing.

I’d assume that resizing big images is the problem, since you’re parsing MBs of data.

I think there’s also some kind of throttling involved here, since if I request just one image every few seconds it basically always works. However if I request multiple images it starts failing, and will recover after few seconds. It would be good to know these limits so I could play around of those.

In this case, I’d say it’s accumulating RAM or CPU-time - instances are kept alive during multiple requests. @KentonVarda said they would change CPU-time to not fail after accumulating (ex with multiple requests over time) and instead fail directly, but that might not have been changed yet.

For example, I saw 10K requests (10K users/unique IP) over 40 seconds work fine, but requests after that started to fail and ever subsequent request after that would also fail. It was due to CPU-time. Unfortunately, tests like that are expensive to create, which is why I only tested 10K at first and could have missed it.