TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Writing a Mini-CDN to Learn Nginx/Prometheus/Grafana/Lua

312 点作者 dreampeppers99超过 2 年前

14 条评论

jay6282超过 2 年前
The hard part of building a CDN is to know when you need it. 99.9% of all websites with CDN do not need it. Serving static files consumes so little resources that a single server can serve billions of users as long as you dont use script for serving the file. The most cost-effective with also the lowest latency solution is to never use CDN. If your webserver provider charge you a lot for traffic you are better off using another provider.
评论 #34142891 未加载
评论 #34141879 未加载
评论 #34139117 未加载
评论 #34146245 未加载
hardwaresofton超过 2 年前
It would be nice to discuss the common approaches to global name resolution —- anycast vs geo-routing.
评论 #34139483 未加载
mnutt超过 2 年前
This is nicely written, and a lot of it mirrors my experience using nginx as a pseudo-cdn. Another area worth exploring might be http3, ssl session caching, and general latency/ttfb optimizations.
sandGorgon超过 2 年前
this is very very cool! One thing i would definitely like to see is domain name resolution. Shopify, Dukaan, Vercel all make a big deal out of it ...going all the way to BGP.<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;subhashchy&#x2F;status&#x2F;1536769406801309696" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;subhashchy&#x2F;status&#x2F;1536769406801309696</a>
nnadams超过 2 年前
Is it possible for CDNs to cache per URL per user? I&#x27;m thinking of something like &#x2F;favorites where one URL would list something different for everyone. When I&#x27;ve setup caching on backend it was keyed off the user.<p>This was a very informative read!
评论 #34139279 未加载
评论 #34139210 未加载
评论 #34138752 未加载
评论 #34141384 未加载
xmorse超过 2 年前
The hard part of building a CDN is scaling it. The best approach imo is to use fly.io to host an anycast IP (with horizontal scaling) and store cache files on disk<p>Fly.io also has a Grafana dashboard built in for your machines
评论 #34139707 未加载
vitorbaptistaa超过 2 年前
Beautifully written! Thanks for sharing, Leandro.
评论 #34137917 未加载
chrsig超过 2 年前
I&#x27;m curious if any HNers have opinions on prometheus vs other time series databases like influxdb?<p>I periodically consider a grafana &amp; backend setup for when datadog becomes cost prohibitive for metrics with several tags.
评论 #34140148 未加载
评论 #34142718 未加载
评论 #34141360 未加载
daniels1006超过 2 年前
Great content, helpful and inspiring.<p>Thanks!
sodez117超过 2 年前
Good read. Is there something similar for building a DDoS protection feature? Like Cloudflare?
zspace2超过 2 年前
Very good project. thanks for sharing
friendlyHornet超过 2 年前
Thanks for this
评论 #34137404 未加载
asjkaehauisa超过 2 年前
Why didn&#x27;t you use varnish for that?
评论 #34141695 未加载
jeacken超过 2 年前
Another example of a project duped into thinking Lua is “powerful”. It is small. That is it. Lua has near zero useful functionality and makes the developer repeatedly reinvent functionality over and over and over again.<p><a href="https:&#x2F;&#x2F;media1.giphy.com&#x2F;media&#x2F;TFO2mwVPIFoOJcuTSC&#x2F;giphy.gif" rel="nofollow">https:&#x2F;&#x2F;media1.giphy.com&#x2F;media&#x2F;TFO2mwVPIFoOJcuTSC&#x2F;giphy.gif</a>
评论 #34140699 未加载
评论 #34140992 未加载
评论 #34143861 未加载