zlacker

[parent] [thread] 5 comments
1. Dextro+(OP)[view] [source] 2023-07-02 01:07:41
Devil's advocate here: did we consider that any such exponential back off goes out the window when users, faced with a non-working site, will just refresh the page therefor reseting the whole process?
replies(1): >>NavinF+e5
2. NavinF+e5[view] [source] 2023-07-02 02:03:15
>>Dextro+(OP)
The server load from that is negligible since those requests stop at the load balancer.

On that note, the 10 requests/second in the post is also negligible for the same reason. Only requests that hit backend servers matter

replies(1): >>8n4vid+Iu
◧◩
3. 8n4vid+Iu[view] [source] [discussion] 2023-07-02 07:03:30
>>NavinF+e5
How does the load balancer know if they hit the tweet limit or not? Sounds like they need to query a db for that
replies(2): >>sheeps+I81 >>NavinF+RB3
◧◩◪
4. sheeps+I81[view] [source] [discussion] 2023-07-02 13:54:22
>>8n4vid+Iu
The load balancer doesn't care about the source of request when it hits a hard requests per second limit. It all depends on how it is configured.
replies(1): >>8n4vid+612
◧◩◪◨
5. 8n4vid+612[view] [source] [discussion] 2023-07-02 19:38:41
>>sheeps+I81
Oh, I was referring to the per user tweet limit
◧◩◪
6. NavinF+RB3[view] [source] [discussion] 2023-07-03 10:22:00
>>8n4vid+Iu
There are a million ways to skin that cat.

Personally I'd just cache HTTP 429 responses for 1 minute, but you could also implement rate-limiting inside the load balancer with an in-memory KV store or bloom filter if you wanted to.

Perhaps the context you're missing is that all large sites use ECMP routing and consistent hashing to ensure that requests from the same IP hit the same load balancer. Twitter only has ~238 million daily active users. 10 requests/second on keepalive TCP+TLS connections can be handled by a couple of nginx servers. The linked "Full-stack Drupal developer" has no idea how any of this works and it's kinda sad how most people in this thread took his post at face value

[go to top]