We survived 10k requests/second: Switching to signed asset URLs in an emergency
151–160 of 176 posts
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#152Rate limiting (and its important cousin, back-off retries) is an important feature of any service being consumed by an "outside entity". There are many different reasons you'll want rate limiting at every layer of your stack, for every request you have: brute-force resistance, [accidental] DDoS protection, resiliency, performance testing, service quality, billing/quotas, and more. Every important service always event…
Like, sure, I have services at work where the answer is "yes". But I have 10 - 20 times more services for which I could cut that to 5 and still be fine.
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#15310k/s... is that a lot? Computers are insanely fast nowadays..!
For short text messages, probably not an issue. With larger stuff like images or video, I would be more careful.
Still, even for text-only, if you're using PostgreSQL, by default you have a limit of (I think) 100 parallel connections (or 97, because I think 3 are reserved for superusers), but each connection can only be executing one transaction at a time, so that can quickly become a bottleneck depending on your application and how fast you need to make queries vs how long your queries take to return a response. So then you might need to tune some PostgreSQL settings, or add caching, or some other way to work around the issue.
If you add more services, then you also need to keep in mind the latency between those services.
And so on and so on. So RAM and network would probably become an issue way earlier than CPU in most cases.
TL;DR: "It depends".
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#154Beauty of cloud :) This could be easily served by a $100/month DO droplet with 0 worries about $.
DO _is_ cloud. Using their droplets compared to someone more sophisticated on GCP is an engineering choice, but both are cloud and both have upsides and downsides, and one needs to understand their needs to make the correct decision both among the different providers and within a provider on the right setup.
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#155Earlier quoted context omitted.
There is no such thing as unlimited bandwidth. What I'm aware of are services which do not charge extra for egress but severely limit your egress bandwidth (like 10 Gbit peak, 100 Mbit avg) And limiting egress bandwidth is better is better done in the service per client than by the hoster for your system
https://getdeploying.com/reference/data-egress Check this out. You _almost_ use the most expensive service. I think you should expand your awareness. Hetzner for instance doesn't mention anywhere that they throttle your 10gbit uplink, but they limit to 20TB/month, with ~1EUR for every TB over. Seems like you wouldn't even have noticed what you described in your article.
Sure there are cheaper options then GCS but, there is no one providing unlimited free bandwidth
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#156Earlier quoted context omitted.
Not on DO. ~$100 a month droplet gets you about 5TB of transfer out. They pulled 15TB in 7 hours. That's ~1,440,000 (16 3 30) on overage or about $15k extra.
Didn't pay attention to transfer figure lets switch DO to CCX43 on Hetzner for $50 more
Are there any providers with free egress?
I used Hetzner many years ago but completely forgot about them.
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#157What I just read is that for the cost of a single 16TB hard drive, they were able to rent a hard drive for 7 hours to stream 16TB, and they still had to devote meaningful engineering resources to avoid the cost overrun. Does anybody here have a success story where AWS was either much cheaper to operate or to develop for (ideally both) than the normal alternatives?
Yeah, I'm confused, too - a $60 server with any decent web server on it should be happy chugging along at 5-15k req/s, right?
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#158What I just read is that for the cost of a single 16TB hard drive, they were able to rent a hard drive for 7 hours to stream 16TB, and they still had to devote meaningful engineering resources to avoid the cost overrun. Does anybody here have a success story where AWS was either much cheaper to operate or to develop for (ideally both) than the normal alternatives?
They don't use AWS, by the way. This was GCP.
Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#159Re: We survived 10k requests/second: Switching to signed asset URLs in an emergency
#160Have you considered putting cloudflare or similar CDN with unlimited egress in front of your bucket? Reading your blogpost I don't fully get how the current signing implementation can halt massive downloads, or the "attacker"(?) would just adapt their methods to get the signed URLs first and then proceed to download what they are after anyway?
Yup. The only mitigation here is that there is a limit to how many different asset URLs they will be able to generate, but if they want to be malicious they can download the same file over and over again and still make you rack up a huge bill.