Hello, I'm trying to understand the proposed pricing structure and how to optimize it. Based on the
Hello, I'm trying to understand the proposed pricing structure and how to optimize it. Based on the proposed pricing in this blog post[1], you get 500 sessions per month for free and then 10 cents per session after that. A session, as I understand it, is an active running browser. The naive approach, at any sort of scale, quickly becomes expensive. So the blog says to use a durable object to keep the browser alive and re-use the existing session instead of starting a new one. The example code uses an alarm to keep the browser alive while idle for 1 minute before shutting it down. Using this structure, If I'm understanding it right. Worst case scenario, if I had a job that triggered every 61 seconds, I'd end up starting about 1440 sessions per day. Which is $144/day or over $4k/mon. That's expensive. So, the solution would be the extend the life of the durable object to, say 2 minutes, which would reduce the $4k to $0, for the browser cost.
However, the durable objects aren't free, but I'm having a much harder time understanding how expensive they will be. For example, why do I need to shut down the browser at all? How much does it cost for the browser to sit idle in a Durable Object? Is that documented anywhere? And what if it's not idle? If my worker is handling 1 request per sec, so the browser is in active use all of the time, what sort of costs is that going to yield for the DO?
Any information would be appericiated.
[1] https://blog.cloudflare.com/running-serverless-puppeteer-workers-durable-objects/
However, the durable objects aren't free, but I'm having a much harder time understanding how expensive they will be. For example, why do I need to shut down the browser at all? How much does it cost for the browser to sit idle in a Durable Object? Is that documented anywhere? And what if it's not idle? If my worker is handling 1 request per sec, so the browser is in active use all of the time, what sort of costs is that going to yield for the DO?
Any information would be appericiated.
[1] https://blog.cloudflare.com/running-serverless-puppeteer-workers-durable-objects/



