How do you rack up a $46k Vercel bill?
๐ **Source:** [How do you rack up a $46k Vercel bill?](https://www.youtube.com/watch?v=ihnGot4nUS4)
> [!note]+ Document Notes
> tags: [vercel, serverless, cost-optimization]
> author: Theo - t3.gg
> source: YouTube
> reference: https://www.youtube.com/watch?v=ihnGot4nUS4
> date created: 2024-12-19 14:30
>
> # ๐ท๏ธ Title: How do you rack up a $46k Vercel bill?
>
<!-- deep-read:sections start -->
## ๐งฐ Action Inbox
- [H1] Implement aggressive caching strategies โ avoid bandwidth costs #cost-optimization
- [H2] Consider Cloudflare Workers vs Vercel for high-traffic sites โ 7x cheaper requests #platform-selection
- [H3] Sample analytics data instead of logging everything โ 36% of bill was analytics #monitoring
## ๐งญ Table of Contents
- [๐ Summary](#-summary)
- [๐ Main Content](#-main-content)
- [๐๏ธ Notes](#๏ธ-notes)
- [๐ References](#-references)
- [๐ฃ๏ธ Paraphrase](#๏ธ-paraphrase)
- [๐ฐ Newsletter](#-newsletter)
- [โ
Action Items](#-action-items)
- [๐งช Hypotheses](#-hypotheses)
- [๐ Methodology](#-methodology)
- [โ Questions](#-questions)
- [๐ฎ Future Research](#-future-research)
- [๐ก Implications](#-implications)
- [๐ง Learning Styles Assessment](#-learning-styles-assessment)
- [๐ Accessibility Assessment](#-accessibility-assessment)
- [๐ DEIB Assessment](#-deib-assessment)
- [โ
Logical Validity](#-logical-validity)
- [๐ก๏ธ DARVO Analysis](#-darvo-analysis)
- [๐ฏ Conclusion](#-conclusion)
### ๐ References
- [Jmail - Epstein Email Interface](URL)
- [Vercel Pricing](https://vercel.com/pricing)
- [Cloudflare Workers Pricing](https://developers.cloudflare.com/workers/platform/pricing/)
## ๐ Summary
- What happened: Jmail creators built a Gmail-like interface for Epstein emails and received a $46k Vercel bill from 650 million page views
- Why it matters: Shows how serverless costs can explode with viral traffic and poor optimization
- Key stakeholders: Developers using serverless platforms, especially those building viral-potential apps
- Risks and tradeoffs: Developer experience vs cost efficiency, caching complexity vs performance
- Bottom line: Vercel's great DX comes at a premium; Cloudflare Workers could be 7x cheaper for high-traffic sites
## ๐ Main Content
The Jmail project, which created a Gmail-like interface for browsing Epstein's emails, demonstrates how serverless costs can spiral out of control. The $46k bill resulted from four main factors: compute costs, bandwidth usage, request volume, and analytics overhead. While the site handled 650 million page views successfully, the creators made several optimization mistakes including serving uncompressed images, aggressive preloading without proper caching, and logging all analytics data without sampling. Vercel ultimately covered the bill and helped optimize the site. The analysis shows Cloudflare Workers would have been significantly cheaper ($2 vs $0.30 per million requests), though with worse developer experience. The case highlights the classic trade-off between ease of use and cost efficiency in serverless platforms.
## ๐๏ธ Notes
#### โฑ๏ธ [00:00](https://youtu.be/ihnGot4nUS4?t=0) โ [H1] $46k Vercel bill breakdown introduction
- Key idea: Jmail creators built Gmail interface for Epstein emails and got massive bill
- Evidence: "They've taken every single one of the Epstein emails and built this like Gmail interface"
#### โฑ๏ธ [01:15](https://youtu.be/ihnGot4nUS4?t=75) โ [H2] Four cost categories: compute, bandwidth, requests, add-ons
- Key idea: Breaking down serverless costs into main components for analysis
- Evidence: "Let's break it down into four sort of categories. You got compute, bandwidth, requests, and like special add-on services"
#### โฑ๏ธ [01:45](https://youtu.be/ihnGot4nUS4?t=105) โ [H3] Compute costs relatively low due to static content
- Key idea: Most content is cacheable JSON that doesn't require heavy processing
- Evidence: "Almost all of the content on this website actually is fairly static content"
#### โฑ๏ธ [02:30](https://youtu.be/ihnGot4nUS4?t=150) โ [H2] Images hosted separately on Cloudflare
- Key idea: Smart move to offload images to cheaper CDN with transformations
- Evidence: "Most of the images on here are probably are not even part of that Vercel bill because they're hosted totally separately"
#### โฑ๏ธ [03:15](https://youtu.be/ihnGot4nUS4?t=195) โ [H1] Unoptimized assets causing bandwidth waste
- Key idea: Half-megabyte uncompressed Facebook icon shows poor asset optimization
- Evidence: "This biggest one right here is over half a meg for a little icon that's being loaded here"
#### โฑ๏ธ [04:00](https://youtu.be/ihnGot4nUS4?t=240) โ [H2] Aggressive preloading trades cost for performance
- Key idea: Site preloads content on hover for fast experience but uses more bandwidth
- Evidence: "They are aggressively loading them all in... it's faster than Gmail. This is a very good experience"
#### โฑ๏ธ [05:30](https://youtu.be/ihnGot4nUS4?t=330) โ [H3] Cloudflare added as cache layer after bill
- Key idea: Caching was implemented post-incident to reduce future costs
- Evidence: "I don't know if this happened before or after the $46,000 bill, but you'll see here they did throw Cloudflare in front of Vercel"
#### โฑ๏ธ [06:15](https://youtu.be/ihnGot4nUS4?t=375) โ [H1] Request volume compounds with traffic
- Key idea: 500 requests per visitor multiplied by 650M views creates massive costs
- Evidence: "500 requests, three and a half megs... 650 million page views. That's a lot of page views"
#### โฑ๏ธ [07:00](https://youtu.be/ihnGot4nUS4?t=420) โ [H2] Vercel pricing: $2 per million requests, 15ยข per GB
- Key idea: Specific pricing breakdown shows how costs accumulate
- Evidence: "Vercel's ondemand bandwidth is 15 cents per gig... $2 per 1 million edge requests"
#### โฑ๏ธ [08:00](https://youtu.be/ihnGot4nUS4?t=480) โ [H1] Analytics comprised 36% of total bill
- Key idea: Web analytics became the largest single cost component
- Evidence: "36% of the bill was simply from web analytics... $2 per 1 million... that adds up very quickly"
#### โฑ๏ธ [08:45](https://youtu.be/ihnGot4nUS4?t=525) โ [H2] Sampling recommended for high-volume analytics
- Key idea: Don't need 100% data capture at scale, similar to Sentry error tracking
- Evidence: "Sampling is probably a good approach here... 50% of that or 25% of that will be enough"
#### โฑ๏ธ [10:00](https://youtu.be/ihnGot4nUS4?t=600) โ [H1] Cloudflare Workers significantly cheaper
- Key idea: Cloudflare offers 7x cheaper requests and mostly free bandwidth
- Evidence: "$2 per 1 million requests versus 30 cents on Cloudflare"
#### โฑ๏ธ [11:30](https://youtu.be/ihnGot4nUS4?t=690) โ [H2] Vercel wins on developer experience despite cost
- Key idea: Better tooling and DX justify higher costs for many developers
- Evidence: "The Vercel DX is the best... the tooling on Vercel is significantly better"
#### โฑ๏ธ [12:30](https://youtu.be/ihnGot4nUS4?t=750) โ [H3] VPS would have crashed under load
- Key idea: Traditional hosting couldn't handle viral traffic without complex scaling
- Evidence: "This site would have definitely have crashed on a VPS or have had a hug of death"
## ๐ References
- [Vercel Pricing Documentation](https://vercel.com/pricing)
- [Cloudflare Workers Pricing](https://developers.cloudflare.com/workers/platform/pricing/)
- [OpenNext Project](https://open-next.js.org/)
## ๐ฃ๏ธ Paraphrase
- A viral email browsing app accumulated a $46k hosting bill due to poor optimization and massive traffic
- The main cost drivers were unoptimized assets, aggressive preloading, high request volumes, and comprehensive analytics logging
- Cloudflare Workers would have been significantly cheaper but with worse developer tooling and experience
## ๐ฐ Newsletter
The recent $46k Vercel bill story offers valuable lessons for WordPress developers about serverless cost management. While WordPress hosting is typically more predictable, the principles of optimization matter just as much.
Key takeaways: optimize your images (WordPress handles this well with WebP support), implement proper caching strategies, and be mindful of analytics overhead. For high-traffic WordPress sites, consider CDN solutions and don't log every single event.
The trade-off between developer experience and cost mirrors WordPress hosting choices - managed WordPress hosting costs more but offers better DX than managing your own VPS.
Resources: [WordPress Performance](https://make.wordpress.org/core/handbook/best-practices/performance/), [Caching Guide](https://developer.wordpress.org/advanced-administration/performance/caching/), [CDN Integration](https://wordpress.org/plugins/search/cdn/)
## โ
Action Items
#### DevRel
- Developer advocacy: Create cost optimization workshops, "bill shock" prevention talks
- Education: Develop serverless cost calculator tools and optimization curricula
- Developer experience: Document cost monitoring best practices, SDK cost warnings
- Developer marketing: Case studies comparing platform costs vs developer experience
- Community management: Cost optimization discussion forums, bill review sessions
#### WordPress
- Core Performance: Image optimization defaults, lazy loading improvements
- Documentation: Cost optimization guides for WordPress hosting platforms
- Hosting: Cross-platform cost comparison tools, optimization recommendations
## ๐งช Hypotheses
- Aggressive preloading increases user satisfaction but exponentially increases costs at scale
- Developer experience quality is inversely related to cost efficiency in serverless platforms
- Analytics sampling at 25% provides sufficient insights while reducing costs by 75%
- CDN-first architecture can reduce serverless bills by 60-80% for content-heavy sites
### ๐ Methodology
- A/B test preloading strategies with cost tracking and user experience metrics
- Survey developers on willingness to trade DX for cost savings at different price points
- Implement progressive sampling rates and measure analytics accuracy vs cost reduction
### โ Questions
- What's the optimal preloading strategy that balances UX and cost?
- How much developer productivity loss is acceptable for 50% cost savings?
- When do VPS solutions become more cost-effective than serverless platforms?
### ๐ฎ Future Research
- Real-time cost monitoring and automatic scaling adjustments for serverless
- ML-driven prediction of viral traffic patterns for proactive optimization
- Cross-platform migration tools for moving between serverless providers
### ๐ก Implications
- Practice: Implement cost monitoring from day one, not after traffic spikes
- Policy: Establish cost thresholds and automatic scaling limits for projects
- Security: Cost-based DDoS attacks become viable on poorly optimized serverless apps
- Education: Developer training must include cost optimization, not just functionality
- Funding: Budget for viral success scenarios, not just expected traffic
### ๐ง Learning Styles Assessment
Reading level estimate: 8th Grade (Flesch-Kincaid)
#### ๐ Visual learners
- Present: Screenshots of developer tools, billing breakdowns, performance metrics
- Improve: Cost comparison charts, traffic spike visualizations, architecture diagrams
#### ๐ Aural learners
- Present: Video format with clear narration and explanations
- Improve: Podcast-style deep dive on cost optimization strategies
#### ๐ฃ๏ธ Verbal learners
- Present: Clear technical definitions, platform comparisons, analogies to traditional hosting
- Improve: Story-driven examples of other viral apps and their cost challenges
#### ๐งฉ Kinesthetic learners
- Present: Code examples, configuration screenshots, hands-on platform exploration
- Improve: Interactive cost calculator, step-by-step optimization checklist
#### ๐ง Logical learners
- Present: Clear pricing breakdowns, mathematical calculations, cause-effect relationships
- Improve: Decision trees for platform selection, cost-benefit analysis frameworks
#### ๐งโ๐คโ๐ง Social learners
- Present: Community discussions about platform choices, shared experiences
- Improve: Developer forums for cost optimization strategies, collaborative optimization reviews
#### ๐งโโ๏ธ Solitary learners
- Present: Detailed technical analysis for independent study
- Improve: Self-assessment tools for cost optimization, personal project worksheets
#### ๐ฟ Naturalistic learners
- Present: Platform ecosystem comparisons, technology evolution patterns
- Improve: Sustainability angles of efficient resource usage, environmental impact
### ๐ Accessibility Assessment
#### Screen reader semantics
- Present: Good heading structure, descriptive link text for platform comparisons
- Improve: Alt text for cost charts, ARIA labels for interactive calculators
#### Keyboard navigation
- Present: Standard video controls, focusable timestamps
- Improve: Skip links for long technical sections, keyboard shortcuts for code examples
#### Contrast and readability
- Present: Clear text on video, readable code snippets
- Improve: High contrast mode for cost charts, larger text options for detailed pricing
#### Text resizing and reflow
- Present: Responsive design works at 200% zoom
- Improve: Ensure code blocks don't overflow, maintain readability at high zoom
#### Media and captions
- Present: Video with clear audio, transcript provided
- Improve: Enhanced captions with speaker identification, downloadable transcript
#### Forms and interactions
- Present: Basic video interactions accessible
- Improve: Accessible cost calculator forms, clear error states for invalid inputs
### ๐ DEIB Assessment
#### Cultural breadth
- Present: US-focused pricing examples and platforms
- Improve: International pricing comparisons, global developer perspectives
#### Inclusive language
- Present: Gender-neutral technical terms, clear jargon definitions
- Improve: Plain language summaries, avoid cultural idioms like "grandma's basement"
#### Neurodiversity support
- Present: Clear section breaks, consistent structure
- Improve: Content warnings for financial stress topics, summary bullets
#### Representation
- Present: Focus on technical content over individual representation
- Improve: Diverse case studies beyond tech industry, varied company sizes
#### Psychological safety
- Present: Non-judgmental analysis of expensive mistakes
- Improve: Emphasize learning from failures, provide supportive resource lists
### โ
Logical Validity
#### Strong reasoning
- Deductive strength: Strong mathematical analysis of pricing structures and cost breakdowns
- Inductive strength: Good generalization from specific case to broader serverless principles
- Causal reasoning: Clear cause-effect relationships between optimization choices and costs
- Analogical strength: Effective comparisons between platforms and traditional hosting
#### Fallacies
- False dichotomy: Presents VPS vs serverless as binary choice, ignoring hybrid approaches
- Hasty generalization: Assumes all high-traffic sites will have similar cost patterns
#### Tone of voice
- Overall tone: Informative and analytical with casual, approachable delivery style
### ๐ก๏ธ DARVO Analysis
- Deny: No denial patterns present
- Attack: No attacks on individuals or organizations
- Reverse victim/offender: No victim/offender dynamics present
- Emotional cues: Balanced analysis without inflammatory language, acknowledges trade-offs fairly
## ๐ฏ Conclusion
The $46k Vercel bill demonstrates that serverless platforms offer excellent developer experience at the cost of potential bill shock during viral traffic. The key lesson is implementing cost monitoring and optimization from the start, not after problems arise. While Cloudflare Workers could have been 7x cheaper, the developer experience trade-offs matter significantly for shipping products quickly. The incident highlights the importance of understanding your platform's pricing model and having contingency plans for unexpected traffic spikes.
## ๐งฑ Refactor Appendix
### ๐ Literature Split Pad
### [H1] Server
---
## Full Transcript
[00:00] $46,000<br>[00:02] Versel bill. How does that possibly<br>[00:05] happen? This was the creators of Jmail.<br>[00:07] They've taken every single one of the<br>[00:09] Epstein emails and built this like Gmail<br>[00:12] interface so you can sort of click<br>[00:14] through and read them and load them and<br>[00:16] filter them by different people. It's a<br>[00:19] really sick website, but they've racked<br>[00:21] up a $46,000 Versel bill. I have large<br>[00:24] sites running on Verscell, Cloudflare,<br>[00:26] and VPS. And I did some quick back of<br>[00:28] the napkin math and I think I know where<br>[00:30] most of this bill went to and we're<br>[00:32] going to break it down so hopefully it<br>[00:34] doesn't happen to you as well. Let's<br>[00:36] break it down into four sort of<br>[00:37] categories. You got compute, bandwidth,<br>[00:40] requests, and like special add-on<br>[00:42] services, right? So compute is is when<br>[00:44] your application actually needs to run<br>[00:46] some processes, right? Whether it's it's<br>[00:47] fetching data from the database or<br>[00:49] looping over arrays, um whether it's<br>[00:51] handling a URL and routing it to<br>[00:53] wherever you go. That is when your<br>[00:56] server actually needs to do work. And<br>[00:59] almost all of the content on this<br>[01:01] website actually is fairly static<br>[01:04] content, right? If you if you go ahead<br>[01:05] and look at a lot of these requests that<br>[01:07] are coming in, you'll see that it's it's<br>[01:09] just JSON that's that's coming in,<br>[01:11] right? So, it's it's just text. Text can<br>[01:13] be cached very heavily. The stuff on<br>[01:15] here is not changing very often. The<br>[01:17] guy's dead, right? He's not sending any<br>[01:19] more emails. Well, I guess that's maybe<br>[01:20] up for debate, but uh there's a lot of<br>[01:24] stuff that can be be cashed on here. So,<br>[01:26] I don't know. It it certainly is<br>[01:28] probably a big expense here, but<br>[01:30] probably not the biggest one because<br>[01:32] they're not doing things like um they're<br>[01:34] not OCRing on demand. They're they're<br>[01:36] not doing any really heavy intensive<br>[01:39] stuff. They are simply just rendering<br>[01:41] out React elements on a page and then<br>[01:43] caching those heavily. So, the next one<br>[01:45] is bandwidth. And this is probably a big<br>[01:47] one, but not what you might think,<br>[01:49] right? You think like, oh, images and<br>[01:51] and whatnot. So, if you go to one of the<br>[01:53] images that are on this website, you'll<br>[01:55] see that they are hosted on a totally<br>[01:57] separate domain name. And this this URL<br>[01:59] here and and the header looking at the<br>[02:00] headers tells me they're using<br>[02:01] Cloudflare image transformations to<br>[02:04] resize them. So, they're they're not as<br>[02:05] big to load on on page load and and<br>[02:07] they're not um using up as much<br>[02:09] bandwidth. Most of the images on here<br>[02:11] are probably are not even part of that<br>[02:13] Versel bill because they're they're<br>[02:15] hosted totally separately. But if we go<br>[02:17] let's go to this homepage here, do a<br>[02:19] hard refresh and then sort them by size,<br>[02:22] you'll see there are some things that<br>[02:23] are being hosted on this. This biggest<br>[02:25] one right here is over half a meg for a<br>[02:28] little uh icon that's being loaded here.<br>[02:31] If we open that up in a new tab, it's<br>[02:34] just a little Facebook icon, not<br>[02:36] compressed at all and probably way<br>[02:38] larger than it needs to be and probably<br>[02:40] could be in SVG. So, serving that up.<br>[02:43] Plus, there are several other like uh<br>[02:46] images that are being loaded in here and<br>[02:49] adding adding all those up, it's it's<br>[02:51] about a meg plus you're looking at all<br>[02:54] of the JavaScript and CSS bundles that<br>[02:56] are being loaded up. That's probably<br>[02:58] close to another meg as well. So every<br>[03:00] single person visiting the website fresh<br>[03:03] cache you're they're using two megs of<br>[03:05] bandwidth which is is is quite a bit.<br>[03:08] Then the other part of the bandwidth<br>[03:11] here is this aggressive preloading. Um<br>[03:14] so if I go to my dev tools I'm going to<br>[03:17] filter for XHR and then as I simply just<br>[03:22] scroll you'll see that there's like tons<br>[03:24] of requests being being fired off. Now,<br>[03:28] I have my cache disabled here, so they<br>[03:30] are loading from my disc cache. But the<br>[03:32] first time that you hover over top of<br>[03:33] those, you'll see it's just a bunch of<br>[03:35] JSON being loaded, but they are<br>[03:37] aggressively loading them all in. Now,<br>[03:40] that is a very high trade-off. And I did<br>[03:43] a video about how McMaster car does this<br>[03:45] as well. Um, because now when you when<br>[03:48] you click on some of these, they load<br>[03:50] extremely fast. Quite honestly, it's<br>[03:52] faster than Gmail. This is a very good<br>[03:54] experience. So you are you have a bit of<br>[03:57] a trade-off where yeah I will<br>[03:59] aggressively preload everything in even<br>[04:02] though we might not use that but you are<br>[04:04] giving them a really nice experience but<br>[04:07] that's not free sending all of this JSON<br>[04:09] over the wire still use quite a bit of<br>[04:12] bandwidth. Now you're probably screaming<br>[04:14] right now mean like that's just text.<br>[04:15] That's static text that probably does<br>[04:17] not change very often. You can cash the<br>[04:19] crap out of that. And that's exactly<br>[04:21] what they're doing. I don't know if this<br>[04:22] happened before or after the $46,000<br>[04:25] bill, but you'll see here they did throw<br>[04:27] Cloudflare in front of Verscell, which<br>[04:29] Verscell doesn't really like you doing,<br>[04:31] but uh you can see that there is a cache<br>[04:34] status of hit here, meaning that that<br>[04:37] should now not go past Cloudflare and<br>[04:41] then send the request to Verscell, which<br>[04:44] which would then incur them bandwidth as<br>[04:47] well as which we'll talk about next is<br>[04:50] request. I think that that was added<br>[04:52] after, but you'll see there is a pretty<br>[04:53] aggressive 30-day and 7-day stalewhile<br>[04:56] validate. So, that brings me to the next<br>[04:57] one, which is simply just paying for<br>[04:59] requests. So, the way that a lot of<br>[05:01] these serverless platforms work is that<br>[05:04] they will charge you for how much um<br>[05:06] time you are using um in compute, but<br>[05:08] then they will also charge you based on<br>[05:10] how many requests you are sending them.<br>[05:12] And because you you load the page up<br>[05:14] here, you get I don't know 50 requests<br>[05:16] to different parts of it. you know,<br>[05:18] you're you're loading in JavaScript and<br>[05:19] CSS and then there's um some React<br>[05:21] server components that need to load in<br>[05:23] different requests. And then of course<br>[05:25] once you start hovering over all of<br>[05:27] these things that just fires up the<br>[05:28] amount of requests. So you spend a<br>[05:30] minute or so kind of just looking<br>[05:32] around, hovering over things, clicking<br>[05:33] on different emails, you get up to 500<br>[05:36] requests fairly quickly. And in this<br>[05:39] case, it's just over a meg. If you load<br>[05:41] a couple emails, I was able to get it up<br>[05:43] to about about three megs worth of it.<br>[05:45] So, if you're doing some some quick math<br>[05:48] on that, you know, 500 requests, three<br>[05:50] and a half megs um for an average<br>[05:52] visitor just visiting for a minute or<br>[05:54] so, um Versel's ondemand bandwidth is is<br>[05:58] 15 cents per gig here. Um and then it<br>[06:02] also is $2 per 1 million edge requests.<br>[06:06] So, if you're looking at me doing, I<br>[06:09] don't know, 500 requests, three and a<br>[06:10] half megs, um, that would cost them a<br>[06:14] tenth of a penny. That's not much,<br>[06:16] right? A tenth of a penny. That that's<br>[06:18] that's almost nothing. But remember what<br>[06:20] they're doing here. 650<br>[06:23] million page views. That's a lot of page<br>[06:26] views. Um, that will add up. My math<br>[06:28] shows me that like without any sort of<br>[06:30] cashing or anything in front of it, that<br>[06:32] could be hundreds of thousands of<br>[06:34] dollars. Obviously, the bill wasn't<br>[06:35] hundreds of thousands of dollars because<br>[06:36] of the what they've done to implement<br>[06:39] the cash there, but that simply will add<br>[06:42] up. Those tenth of a pennies add up.<br>[06:44] Now, the next one, which is like<br>[06:46] add-ons. So, they actually Versel<br>[06:50] stepped up and said, "Yeah, like we'll<br>[06:51] cover the bill." Which was really cool<br>[06:52] of them. Um, and then they went through<br>[06:54] it and said like, "Yeah, like we're<br>[06:56] going to figure out how to how to get<br>[06:57] this thing as cheap as possible." And it<br>[07:00] turns out 36% of the bill was simply<br>[07:04] from web analytics. Um so what pages do<br>[07:08] people visit? Uh like where are they<br>[07:11] coming from? What browser? You know, you<br>[07:12] know, all of that stuff that you get in<br>[07:14] analytics. But the thing that sort of<br>[07:16] killed them here is that they were I<br>[07:18] guess the analytics double dip on the<br>[07:20] request. So, you're paying for<br>[07:22] analytics, but then you're also paying<br>[07:24] for those requests, um, those edge<br>[07:27] requests that are going in there. And if<br>[07:29] you take a look here, remember $2 per 1<br>[07:32] million. And if you're logging all kinds<br>[07:34] of of data being sent over here, that<br>[07:37] that adds up very quickly. So, GMO goes<br>[07:40] on to mention that like sampling is<br>[07:42] probably a good approach here. Um, and<br>[07:44] this is exactly what Sentry does as well<br>[07:46] is if if you were you can send every<br>[07:49] single every error that happens on your<br>[07:51] website to Sentry. But if you have<br>[07:54] enough traffic, that's likely too much<br>[07:57] and it's you don't necessarily need all<br>[07:59] of that data at super high volume. So<br>[08:01] what you can do is just sample those and<br>[08:03] you still get all of the information<br>[08:05] that you're looking for. You don't need<br>[08:06] to know that what 50,000 people had like<br>[08:10] a a missing undefined variable on there.<br>[08:13] um simply 50% of that or 25% of that<br>[08:17] will be enough. Processing and storing<br>[08:19] data is is not cheap. My personal<br>[08:22] opinion, 17 grand for analytics seems<br>[08:25] extremely high, but I think we all got<br>[08:28] used to to using Google Analytics as a<br>[08:31] as a free product. We didn't realize how<br>[08:33] expensive holding, processing, storing<br>[08:36] all of that data actually is. Now, the<br>[08:38] question is is would Cloudflare be<br>[08:40] cheaper? Right? So we sort of know what<br>[08:43] the big costs were here, right? There<br>[08:44] was bandwidth, there was requests, and<br>[08:46] then there was those those analytics<br>[08:48] being added on here. So let's go through<br>[08:50] it. So Versell and Cloudflare both have<br>[08:52] the ability to charge based on what's<br>[08:54] called CPU time. You have an 800 se 800<br>[08:57] millisecond serverless function that's<br>[08:59] running, but maybe you're only using 50<br>[09:02] milliseconds, 30 milliseconds of that to<br>[09:04] do actual compute. You're looping over<br>[09:06] an array. You're creating objects. You<br>[09:08] have classes. things like that is is<br>[09:10] actual compute. Whereas like if you send<br>[09:13] off a fetch request and you're waiting<br>[09:15] 200 milliseconds for like an AI to<br>[09:18] respond, you don't have to pay for that<br>[09:20] time, which is is really cool. That's<br>[09:22] different from traditional serverless<br>[09:24] where you're simply just paying for the<br>[09:26] time that that thing is running. So<br>[09:28] Cloudflare calls that wall time um<br>[09:30] versus CPU time and Versell calls that<br>[09:33] fluid compute. Next one is bandwidth.<br>[09:36] Cloudflare is mostly free. Everybody<br>[09:39] likes to say Cloudflare is the bandwidth<br>[09:40] is free and and that is is mostly true.<br>[09:43] But um for the images that they're<br>[09:45] they're hosting on Cloudflare here, you<br>[09:47] certainly pay for for that product and<br>[09:49] you pay to hold those images. You pay<br>[09:51] based on number of transformations that<br>[09:53] you use, the number of requests that<br>[09:54] that go to that. But things like um your<br>[09:58] CSS, your your JavaScript um those sort<br>[10:03] of static assets that can be cached, you<br>[10:06] don't pay for for bandwidth on those<br>[10:08] types of things, which is is really<br>[10:10] really nice. So that would have<br>[10:11] significantly decreased their bill,<br>[10:13] especially for their um 650k<br>[10:16] little logo that they have here. Next<br>[10:19] one is request. So, this is kind of a<br>[10:22] kind of a weird one because if you put<br>[10:25] Cloudflare in front of an existing<br>[10:29] website, maybe you host it on like a VPS<br>[10:31] or maybe you host it on Verscell and you<br>[10:32] throw this cache control header and the<br>[10:35] CDN cache control header on there. What<br>[10:38] that will do with Cloudflare is<br>[10:41] Cloudflare will simply just serve up the<br>[10:43] cache version. However, if you are<br>[10:45] programmatically doing your cache as<br>[10:46] part of your worker um or if you are<br>[10:49] hosting your entire website on a worker,<br>[10:52] you it still hits your worker on<br>[10:54] Cloudflare and you still pay for that<br>[10:57] request to Cloudflare even if you simply<br>[10:59] are um serving up. I I hit this with my<br>[11:02] own personal websites like that seems<br>[11:04] higher. I was trying to cache entire<br>[11:07] HTML pages, but because my entire site<br>[11:10] was inside of a worker, even though I<br>[11:12] was serving up the cache version of that<br>[11:14] HTML, I still paid for that request to<br>[11:17] there. But let's talk about the actual<br>[11:20] prices of this thing. So requests on<br>[11:22] Cloudflare are<br>[11:24] um you get 10 million a month and then<br>[11:26] 30 cents per million and then your CPU<br>[11:30] time, you get 30 million CPU<br>[11:32] milliseconds. Essentially, this works<br>[11:35] out to being 7.2 cents per hour. Um,<br>[11:39] that's not like you don't take 7.2 cents<br>[11:42] and multiply by 24. That's just<br>[11:44] basically how much time those processes<br>[11:47] are running. Taking a look at Versell,<br>[11:50] um, we we saw this already, $2 per 1<br>[11:52] million requests versus 30 cents um, on<br>[11:55] Cloudflare. And then CPU time is about<br>[11:59] 12 cents uh, 13 cents an hour. So<br>[12:01] between those three things,<br>[12:03] significantly cheaper CPU time, um<br>[12:06] significantly cheaper bandwidth or or<br>[12:08] free bandwidth in in many cases, um and<br>[12:10] then also significantly cheaper<br>[12:12] requests. You probably would have been a<br>[12:14] lot lower. There's a lot to be said for<br>[12:17] Cloudflare here. Um and the reason why<br>[12:19] not absolutely everybody is on<br>[12:21] Cloudflare is because the Versel DX is<br>[12:24] the best. Um and I say this as someone<br>[12:26] who absolutely loves Cloudflare. I've<br>[12:28] got many gripes with it. Like the other<br>[12:30] day we couldn't get logs for a preview<br>[12:32] of URLs. You can't get custom domains<br>[12:34] for preview URLs. Having like staging in<br>[12:36] production is a pain in the butt.<br>[12:38] There's lots of things which on Verscell<br>[12:41] sharing um I couldn't share a worker<br>[12:43] with somebody. The the solution to was<br>[12:45] move the entire domain and worker to a<br>[12:47] different Cloudflare account and then<br>[12:49] you can share that entire account with<br>[12:52] somebody else. So the tooling on<br>[12:54] Verscell is significantly better. But a<br>[12:57] lot of people will simply just say um<br>[13:00] I'm I'm okay with with a little bit of<br>[13:03] pain or figuring out these oddities on<br>[13:05] Cloudflare for the price. Now analytics.<br>[13:07] Cloudflare has free web analytics. As<br>[13:09] far as I can tell, they are at feature<br>[13:11] parody and I don't think that they count<br>[13:14] towards your actual requests and you<br>[13:16] don't have to pay for them. So that that<br>[13:18] again $17,000 that that would have been<br>[13:21] saved. Now, what about a VPS? Could you<br>[13:24] have done this on a $5 a month uh like<br>[13:27] digital ocean? Could you host it in your<br>[13:29] grandma's basement? That type of thing<br>[13:32] maybe with you would certainly have to<br>[13:35] put an aggressive cache in front of it.<br>[13:38] And you would have to set up<br>[13:39] autoscaling, load balancing, all of that<br>[13:41] type of stuff. So, um I don't know like<br>[13:43] render railway, these types of things.<br>[13:45] they for $46,000 you can let those<br>[13:48] things scale up to 7 8 n 10 different<br>[13:51] instances for for quite a bit cheaper<br>[13:54] than than 46k. But the thing that people<br>[13:58] aren't talking about with these VPS's is<br>[14:00] that like you still need a CDN in front<br>[14:03] of these things that will handle all of<br>[14:06] your caching because bandwidth coming<br>[14:08] from a VPS is is extremely expensive.<br>[14:11] So, my thoughts here, one, this bill<br>[14:13] would not have been nearly as large on<br>[14:16] Cloudflare. Two, this site would have<br>[14:18] definitely have crashed on a VPS um or<br>[14:21] have had a hug of death from it, right?<br>[14:23] There's always that thing like, should<br>[14:24] you go down or should you pay more when<br>[14:26] you get these crazy spikes in traffic?<br>[14:28] And then third, this site and many other<br>[14:31] people's hobby projects may not have<br>[14:33] launched if it wasn't for Versel. Versel<br>[14:36] has made this stuff super easy to sort<br>[14:38] of just publish and out there. However,<br>[14:41] we hear these stories all the time where<br>[14:43] something gets popular and somebody<br>[14:45] goes, "Shoot, I this thing is costing<br>[14:47] way more than I thought it would."<br>[14:49] Everything in life is a trade-off.<br>[14:51] There's Open Nex where you can host Next<br>[14:53] Nex.js on Cloudflare. Not perfect. I<br>[14:55] tried it myself for quite a while and I<br>[14:56] ended up just scrapping Nex entirely,<br>[14:58] moving to Wacku. But build on tech that<br>[15:01] can be moved absolutely anywhere. So<br>[15:03] that if something like this happens to<br>[15:05] you and you have the fortune of having<br>[15:08] an extremely popular website, hopefully<br>[15:09] it's not going to cost you an arm and a
<!-- deep-read:sections end -->