Pricing running a graphql server on Workers vs Node.js

I am curious what's the cost difference is running a graphql server on workers Vs hosting yourself - eg via Node.js on something like CloudRun or AWS. Any ideas how I could get some rough estimates on this?
3 Replies
simplenotezy
simplenotezyOP6mo ago
I've asked ChatGPT and this is it's response: ``` #### Cloudflare Workers: - Requests: 100 million - 100,000 free = 99.9 million requests. - 99.9 million requests / 1 million * $5 = $499.50 - Data Transfer: Let's assume $0.10 per GB. Total: $499.50 + $0.10 = $499.60 #### Google Cloud Run: - Requests: 100 million - 2 million free = 98 million requests. - Requests cost: 98 million / 1 million * $0.40 = $39.20 - Compute Time: 100ms per request * 100 million requests = 10 million seconds. - Compute cost: 10 million / 3600 (hours) * $0.00002428 per vCPU second (assuming 1 vCPU) = $67.44 - Memory Cost: Assuming 256MB memory per instance. - Memory cost: 10 million seconds * 0.0000025 per GB-second (256MB is 0.25GB) = $25.00 - Data Transfer: Assuming $0.12 per GB. Total: $39.20 + $67.44 + $25.00 + $0.12 = $131.76 #### AWS Lambda: - Requests: 100 million - 1 million free = 99 million requests. - 99 million / 1 million * $0.20 = $19.80 - Compute Time: 100ms per request * 100 million requests = 10 million GB-seconds. - Compute cost: 10 million GB-seconds - 400,000 GB-seconds free = 9.6 million GB-seconds. - 9.6 million * $0.00001667 per GB-second = $160.83 - Data Transfer: Assuming $0.09 per GB. Total: $19.80 + $160.83 + $0.09 = $180.72 Percentage Comparison We'll use the highest cost (Cloudflare Workers) as the reference point. 1. Cloudflare Workers: $499.60 2. Google Cloud Run: $131.76 3. AWS Lambda: $180.72 Highest cost is Cloudflare Workers: $499.60 - Cloudflare Workers: ($499.60 / $499.60) * 100 = 100% - Google Cloud Run: ($131.76 / $499.60) * 100 ≈ 26.38% - AWS Lambda: ($180.72 / $499.60) * 100 ≈ 36.17% Summary - Cloudflare Workers: 100% - Google Cloud Run: 26.38% - AWS Lambda: 36.17%
Chaika
Chaika6mo ago
too vague. What are you going to use to run a graphql server on workers? Workers are V8 Isolates, not nodejs or anything, and not containers, restricted environment
#### Cloudflare Workers: Requests: 100 million - 100,000 free = 99.9 million requests. 99.9 million requests / 1 million * $5 = $499.50 Data Transfer: Let's assume $0.10 per GB.
and this is all just wrong, I wouldn't ask Chatgpt about pricing stuff. Workers have no transfer fees, and are $0.30 per mil requests, not $5 + cpu time (which can vary) Workers Paid also gives you 10 mil requests for free, not 100k
simplenotezy
simplenotezyOP6mo ago
Interesting, thanks for the heads up. Currently using this library: https://github.com/kimyvgy/worker-apollo-server-template
GitHub
GitHub - kimyvgy/worker-apollo-server-template: Deploy Apollo Serve...
Deploy Apollo Server v4 to Cloudflare Workers. Contribute to kimyvgy/worker-apollo-server-template development by creating an account on GitHub.
Want results from more Discord servers?
Add your server