I’m using puppeteer to do some crawling and I was testing it on an API. After I finished the code and put it on a queue it starts to slow down the queue to always exceed cpu usage. The logs in realtime take forever to update and the queue stops processing new messages until the message that exceed cpu finish. At first I thought it was my code, so I commented some things and got to a point when I just launch the browser, log something and then close the browser. I also tried to explicit acknowledge messages and added a return at the end just to make sure some kind of “keep executing forever” error wasn’t the problem. The same response Anytime I remove puppeteer code the queue executes instantly with the logs. If I try to launch the browser, it exceeds cpu. The config is the same as the docs example with some name changes.
After nothing worked I tried to use the same exact code from cloudflare documentation about how to do a crawler with puppeteer on a queue. The only change I’ve done to the code was changing the “kv put” code to a simple console.log. The behavior was the same.
Does someone else has the same problem? What could be the cause and does anyone has an example of puppeteer running on a queue worker without problems?