Merge 7067a91fd9
into 40d5d2edcc
commit
ef2c22340b
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
|
@ -545,7 +545,7 @@ DNS 是階層式的架構,一部分的 DNS 伺服器位於頂層,當查詢
|
|||
|
||||
[CloudFlare](https://www.cloudflare.com/dns/) 和 [Route 53](https://aws.amazon.com/route53/) 提供了 DNS 的服務。而這些 DNS 服務商透過以下幾種方式來決定流量如何被分派:
|
||||
|
||||
* [加權輪詢](http://g33kinfo.com/info/archives/2657)
|
||||
* [加權輪詢](https://www.jscape.com/blog/load-balancing-algorithms)
|
||||
* 防止流量進入正在維修中的伺服器
|
||||
* 在不同大小的集群中進行負載平衡
|
||||
* A/B 測試
|
||||
|
|
19
README.md
19
README.md
|
@ -124,6 +124,7 @@ Review the [Contributing Guidelines](CONTRIBUTING.md).
|
|||
* [Active-active](#active-active)
|
||||
* [Layer 4 load balancing](#layer-4-load-balancing)
|
||||
* [Layer 7 load balancing](#layer-7-load-balancing)
|
||||
* [Consistent Hashing](#consistent-hashing)
|
||||
* [Horizontal scaling](#horizontal-scaling)
|
||||
* [Reverse proxy (web server)](#reverse-proxy-web-server)
|
||||
* [Load balancer vs reverse proxy](#load-balancer-vs-reverse-proxy)
|
||||
|
@ -689,6 +690,7 @@ Load balancers can route traffic based on various metrics, including:
|
|||
* [Round robin or weighted round robin](https://www.g33kinfo.com/info/round-robin-vs-weighted-round-robin-lb)
|
||||
* [Layer 4](#layer-4-load-balancing)
|
||||
* [Layer 7](#layer-7-load-balancing)
|
||||
* Consistent Hashing
|
||||
|
||||
### Layer 4 load balancing
|
||||
|
||||
|
@ -700,6 +702,23 @@ Layer 7 load balancers look at the [application layer](#communication) to decide
|
|||
|
||||
At the cost of flexibility, layer 4 load balancing requires less time and computing resources than Layer 7, although the performance impact can be minimal on modern commodity hardware.
|
||||
|
||||
### Consistent Hashing
|
||||
|
||||
Consistent hashing is a technique used in load balancing to distribute requests evenly across multiple servers in a distributed system.
|
||||
|
||||
Here's how it works:
|
||||
|
||||
* <b>Hash Ring:</b> Imagine a virtual circle, called a hash ring. Each server and each incoming request is assigned a position on this circle based on a hash function. The hash function ensures that the same input (server ID or request data) always gets mapped to the same position on the ring.
|
||||
|
||||
* <b>Request Distribution:</b> When a request arrives, its data (often a unique identifier) is hashed to determine its position on the hash ring. The server responsible for handling the request is the one whose position on the ring comes after the hashed request data, continuing clockwise around the circle.
|
||||
|
||||
* <b>Scalability and Consistency:</b> The key benefit of consistent hashing is its scalability. If a server is added or removed, only requests that map to the immediate vicinity of the affected server will be re-routed. Most requests will continue to be directed to the same servers as before. This minimizes data re-caching and avoids creating hotspots where certain servers become overloaded
|
||||
|
||||
<p align="center">
|
||||
<img src="images/jsjss.png">
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
### Horizontal scaling
|
||||
|
||||
Load balancers can also help with horizontal scaling, improving performance and availability. Scaling out using commodity machines is more cost efficient and results in higher availability than scaling up a single server on more expensive hardware, called **Vertical Scaling**. It is also easier to hire for talent working on commodity hardware than it is for specialized enterprise systems.
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Loading…
Reference in New Issue