zlacker

[parent] [thread] 3 comments
1. 8n4vid+(OP)[view] [source] 2023-07-02 07:03:30
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+0E >>NavinF+973
2. sheeps+0E[view] [source] 2023-07-02 13:54:22
>>8n4vid+(OP)
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+ow1
◧◩
3. 8n4vid+ow1[view] [source] [discussion] 2023-07-02 19:38:41
>>sheeps+0E
Oh, I was referring to the per user tweet limit
4. NavinF+973[view] [source] 2023-07-03 10:22:00
>>8n4vid+(OP)
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]