TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

I won free load testing

461 pointsby 0xedbabout 3 years ago

27 comments

oefrhaabout 3 years ago
&gt; As for fly.io, well, I work there, so, they pay me.<p>Well, that’s nice and all, but if a fly.io customer were attacked with 3.1GB&#x2F;s throughput, according to the lowest outbound bandwidth price of $0.02&#x2F;GB [1] they’d be burning at least $3.72&#x2F;min. 6 times that if attacked from India. That would be a lot less fun.<p>[1] <a href="https:&#x2F;&#x2F;fly.io&#x2F;docs&#x2F;about&#x2F;pricing&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fly.io&#x2F;docs&#x2F;about&#x2F;pricing&#x2F;</a><p>Edit: They mentioned they waive charges as a result of attacks: <a href="https:&#x2F;&#x2F;community.fly.io&#x2F;t&#x2F;about-rate-limiting&#x2F;156&#x2F;4" rel="nofollow">https:&#x2F;&#x2F;community.fly.io&#x2F;t&#x2F;about-rate-limiting&#x2F;156&#x2F;4</a>
评论 #31236884 未加载
评论 #31233665 未加载
评论 #31232851 未加载
tothrowawayabout 3 years ago
OpenResty (Nginx + LuaJIT) can help you limit the damage of unsophisticated DDoS attacks like these. I keep a count of the requests-per-second I&#x27;m getting in each nginx worker. I also set a special cookie for every response from the upstream (it could literally be foo=bar). When the RPS goes approve a certain threshold, if the special cookie is not present, I serve a static HTML page (bypassing the upstream) that sets the cookie and reloads the page (Nginx can do 20K+ RPS without breaking a sweat). In my experience, these fly by DDoS attacks never use cookies, so legitimate users can get through, but the bots are blocked.<p>Of course, if you get hit with something slightly more targeted, this defense is worthless.
评论 #31233112 未加载
fasterthanlimeabout 3 years ago
Mirror in case the attack successfully picks up again: <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20220502013024&#x2F;https:&#x2F;&#x2F;fasterthanli.me&#x2F;articles&#x2F;i-won-free-load-testing#" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20220502013024&#x2F;https:&#x2F;&#x2F;fastertha...</a><p>As a treat, this is a testament to a logic error I made in the caching code (inserted uncachable versions of pages into the cache for a little while). Enjoy!
评论 #31232604 未加载
评论 #31231856 未加载
ameliaquiningabout 3 years ago
Regarding the issue of people sending requests directly to your server, bypassing Cloudflare: While you can use IP allowlisting for this, Cloudflare can also be configured to send requests to your server exclusively over mTLS, with a client certificate chaining up to a root CA which they publish. If I were worried about this kind of attack, I&#x27;d probably turn that feature on (and then reject requests that don&#x27;t present a valid client cert); I don&#x27;t fully trust IP allowlisting. (On the other hand, I can&#x27;t say for sure that the performance overhead wouldn&#x27;t be a problem in a DDoS scenario. But it doesn&#x27;t seem super likely?)
评论 #31232427 未加载
评论 #31232424 未加载
jrockwayabout 3 years ago
Fun!<p>I tend to be paranoid about exposing things to the Internet, so just put my raw servers behind Envoy. I have tuned that to do rate limiting, circuit breaking (stop sending requests to an upstream when it returns too many errors), idle connection termination, and to shed load when a certain amount of memory is in use, so without any additional configuration for a new service behind the proxy it&#x27;s somewhat difficult to get the proxy and other services to not respond at all.<p>I&#x27;m guessing that in a real attack, the rate limiting service is a weak link. I use a custom rate limit service to aggregate rate limits across a &#x2F;24 (and hacked that together in an evening), and that is likely the first thing to blow up and erroneously deny service to legitimate users. (I&#x27;m sure I have it set up to fail closed, which will be annoying.)<p>I had a hard time ever generating enough load to test any of this for the static serving path. I just set up a mirror of my production environment on my workstation, limited the critical services (Envoy + nginx + rate limit + Redis) to some low amount of CPUs, and then had 31 workers generate synthetic load. I was able to get circuit breakers to open to at least prove that that code works, but I somehow think that I&#x27;ll run out of network bandwidth before I run out of memory to keep track of open streams. Difficult to load test when the upstream can respond to most requests out of memory.<p>Would be interesting to dig into it more. But for those of you reading this and thinking &quot;I&#x27;m going to launch an attack right now&quot;, I will just turn off the site if I go over my bandwidth quota. Clone the config repo, host everything locally, run your tests, and send me the results ;)
tristorabout 3 years ago
This inspired me to actually look at my CloudFlare stats, and I realized it&#x27;s not caching some of my HTML pages even though I had page rules setup to cache everything. I use a static site generator, and it&#x27;s never been an issue at this point (nobody has any reason to DDoS me). But this is a good motivator to fix that up. I&#x27;ve been procrastinating on fixing a few things on my site, so I&#x27;m adding this to the list when I update it. I might also setup the CloudFlare Tunnel at the same time.
评论 #31237179 未加载
ReactiveJellyabout 3 years ago
It&#x27;s more fun in my head if &quot;CloudFlare Attack Mode&quot; allows you to wield CloudFlare as a Black-ICE weapon<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Intrusion_Countermeasures_Electronics#blackice" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Intrusion_Countermeasures_Elec...</a>
CraigJPerryabout 3 years ago
I had never considered service back-pressure or circuit breakers until it became a buzz in the java world a few years ago. The concepts are universal though and genuinely interesting building blocks for architecture.<p>Site Reliability Engineering is a fascinating problem space.
justinsaccountabout 3 years ago
Probably doesn&#x27;t matter much with only a few networks, but this is using the wrong data structure:<p><pre><code> if let Some(net) = ip_nets.load() .iter() .find(|net| net.contains(&amp;addr.ip())) </code></pre> ip_nets is a &#x27;HashSet&lt;IpNet&gt;&#x27; but it should be a radix&#x2F;patricia tree.<p>Something like <a href="https:&#x2F;&#x2F;lib.rs&#x2F;crates&#x2F;iprange" rel="nofollow">https:&#x2F;&#x2F;lib.rs&#x2F;crates&#x2F;iprange</a>
评论 #31238856 未加载
评论 #31239679 未加载
评论 #31239185 未加载
daenzabout 3 years ago
Out of curiosity, I googled how much a DDoS attack goes for these days. Apparently they can cost as low as $10&#x2F;hour. I don&#x27;t know if the shady people will deliver, but that&#x27;s what the internet says. So apparently it&#x27;s pretty easy to DDoS anyone and make it difficult to trace back to you.
评论 #31231480 未加载
mwcampbellabout 3 years ago
&gt; if you want to skip it, search for &quot;After the storm&quot;.<p>&gt; Yes, yes, I know, I should add anchor links for headers.<p>This is a rare case where blind people using screen readers have it (a little) easier. Every serious screen reader I know of has a command to skip to the next heading. It&#x27;s too bad most sighted web users don&#x27;t have a similar feature handy.
评论 #31232726 未加载
mastaxabout 3 years ago
That was fun! Showed some caveats to &quot;I have cloudflare so I&#x27;m fine.&quot;
the_alchemistabout 3 years ago
What a great post-mortem write-up! Thans for sharing
weird-eye-issueabout 3 years ago
For sites that are mostly read only from non-logged in users Cloudflare can be great. I&#x27;ve got a WordPress content site configured with Cloudflare&#x27;s APO. Almost 100% of actual human requests for HTML pages or static resources are cached. And there are also a few caching layers at the server level too (setup automatically by Cloudways). The site generates around $15k per month and growing fast on an overprovisioned $50&#x2F;mo server. I don&#x27;t think I&#x27;ll need to spend much more on hosting at even 10x the current traffic due to the caching by Cloudflare. Maybe a bit more for disk space since we store large images but DigitalOcean&#x27;s Block Storage also makes that incredibly cheap
评论 #31233125 未加载
d4aabout 3 years ago
&gt; That lets me answer questions like &quot;what RSS readers (that aren&#x27;t browsers) is my audience using?&quot;<p>Very interesting... I also use NNW and FreshRSS
mleonhardabout 3 years ago
I&#x27;m working on two projects that could let a stand-alone Rust web server weather a moderate DDoS attack like the author had:<p>Beatrice [0] - A web server with built-in connection limits and thread limits. It&#x27;s async but supports non-async request handlers.<p>fair-rate-limiter [1] - In theory, one could use this to shed most of the load from DDoS attacking nodes.<p>[0] <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;beatrice" rel="nofollow">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;beatrice</a><p>[1] <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;fair-rate-limiter" rel="nofollow">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;fair-rate-limiter</a>
junonabout 3 years ago
&gt; The traffic doesn&#x27;t look like something like headless Chrome was used<p>Setting aside the fact that headless chrome or other browser testbeds do a good job at hiding their presence, what could be the vector for a botnet infection if this were true? Extensions?
评论 #31236206 未加载
评论 #31233484 未加载
评论 #31234636 未加载
2143about 3 years ago
&gt; Minutes after I posted this article, the attack resumed. Same shit, different AS.<p>Noob question: was that caused by the article getting posted to HN? Or was it really an attack?
mou_sesp_azabout 3 years ago
This guy has some great energy.<p>And humor:<p>&gt;&gt; Because it doesn&#x27;t return an AddrStream but instead a Pin&lt;Box&lt;TimeoutWriter&lt;TimeoutReader&lt;TcpStream&gt;&gt;&gt;&gt;...<p>&gt;&gt; Gesundheit.
langsoul-comabout 3 years ago
I&#x27;m interested in what the fly.io would cost if you didn&#x27;t work there.<p>I got a fly app and can&#x27;t proxy it through cloudflare cause that doesn&#x27;t work.
评论 #31233008 未加载
floor_about 3 years ago
A security audit of my small 6 person office found a Digital Ocean machine trying to brute force one of our Windows machines. I&#x27;m becoming less and less impressed with Digital Ocean as time goes on.
评论 #31234333 未加载
评论 #31234138 未加载
评论 #31237860 未加载
dym_shabout 3 years ago
does it make you a freeloader xD
minrootabout 3 years ago
Not to criticize, but how the hell do you write this long posts? Why don&#x27;t others do it too?
评论 #31231578 未加载
评论 #31231894 未加载
andrelaszloabout 3 years ago
I was very surprised to see that your article about golang got flagged here on HN. Never realized that go was such a sensitive topic. I assume this is related? Can anyone in the golang community give some context?
评论 #31233422 未加载
评论 #31232010 未加载
评论 #31232501 未加载
评论 #31232006 未加载
评论 #31232028 未加载
评论 #31234000 未加载
oxffabout 3 years ago
Why was the site breaking under such a little stress? For requests per second, that is really not that much.
评论 #31234914 未加载
评论 #31234907 未加载
komuWabout 3 years ago
The code in this article is great advertisement for Golang.<p>Pin&lt;Box&lt;TimeoutWriter&lt;TimeoutReader&lt;TcpStream&gt;&gt;&gt;&gt;? Gesundheit indeed.<p>Great writing as always.
评论 #31232256 未加载
londons_exploreabout 3 years ago
34 million requests really isn&#x27;t many.<p>Bigger sites might handle that number of requests every second. Hand coded and highly optimized services can handle that number of cached small requests every minute <i>on one machine</i>. After all, that&#x27;s only an egress rate of a few GBits. And your homepage certainly ought to be both cached and small.
评论 #31235878 未加载
评论 #31234559 未加载
评论 #31232530 未加载