大网数据广告活动
服务器运维问答

How does a typical http(s) load balancer work?

· 52CE 我爱测

I know that there are some situations that we encounter heavy http(s) load on a server and we should use a load balancer to distribute load among several back-end servers. But I've a confusion here! Lets suppose that too many use…

问题原文

原帖链接 · Ehsan Khodarahmi · CC BY-SA 3.0

I know that there are some situations that we encounter heavy http(s) load on a server and we should use a load balancer to distribute load among several back-end servers.
But I've a confusion here! Lets suppose that too many users (lets say 100,000) are trying to access simultaneously to example.com:80 and a load balancer (e.g Apache mod_proxy_balancer or any other stand-alone load balancer) wants to distribute this load among several back-end servers, but still all traffic has to be passed across the front-end server which brings about a heavy traffic on that server & even though all the requests are parsing at back-end servers, front-end server still have to manage them (suppose that in best case it has to create a single unique thread for every request which causes this server simply crash after creating 100,000 threads at a moment!).
Now my question (that may sounds funny to an expert!) is that how a load balancer can handle such situation? In other words, how front-end server can establish a link directly between clients & back-end servers without having to tolerate such heavy network load? (I know in this situation we can't call back-end servers really 'back-end'! but assume that its OK for now) Does this scenario need any application-specific alter? (e.g. in order to simply redirect clients with http Location header to other servers)

社区高分解答

原帖链接 · Esa Jokinen · CC BY-SA 3.0

This depends on the purpose of the load balancer i.e. what type of workload it's supposed to balance. The reverse proxy based HTTP(S) load balancers are distributing the load between application back-ends generating the content.

Reverse proxies are not trying to balance network load, and compared to all the tasks dynamic applications do, passing network traffic (and possibly serving static content) is a relatively simple task.

For example, database access can be load balanced, too. Most of the database queries involves only reading from the database, so while writes needs to be replicated immediately across all the database servers, reads can be distributed evenly.

Network load balancing is a different area. For example, one common method for balancing (network) load between cluster servers is round-robin DNS records, where the same hostname simply has more than one A records.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-08-05)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。