Live data from Hacker News

Load Balancing

samwho.dev

241–243 of 243 posts

Re: Load Balancing

#241
post #167

Several years ago, I implemented an application specific load balancer where the LB kept two queues. One was free_workers and the other was open_requests . Initially, upon startup, each worker registers itself with the LB and gets added to the free_workers queue. When requests arrive at the LB, the LB checks if there are free workers available. If yes, it dequeues a free worker and dispatches the request to that work…

But then your LB is a single point of failure! Even if you were to spin up duplicate copies of the LB that could be failed-over-to in real time, there is still the drawback that you are bounded by the number of requests you can store on a single machine.

I think what you actually built is a message queue engine that forwards the data to the consumers, not a load balancer.

Re: Load Balancing

#242
Just throwing another positive comment into the fray: Amazing work on this article. Informative, and easy to digest despite being a complex subject. Well done! I learned a lot from this article.

Re: Load Balancing

#243
post #199

Earlier quoted context omitted.

I keep having to turn off keepalive between the service and the reverse proxies and I bet this is part of why. I think Node 12 introduced LIFO queuing for connection pools because they found the cost of silent disconnects from the server to be too high. They got much better histograms by using the most recently freed connection instead of round robin of available sockets.

I don't remember the URL (sorry) but I saw something recently talking about Facebook's queueing approach for requests being FIFO under normal load and LIFO when overloaded, so that under an overload state you serve the number of requests you -can- serve reasonably quickly rather than -everything- timing out. For node's situation that sounds probably workable but I think a lot of the time I'd prefer to send periodic k…

SYN Flooding is solved by holding a lottery and dropping a certain fraction of all traffic, rather than looking for patterns that could be gamed.
Post reply on HN