Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 协议低效 – TCP 是一个适配协议, 搜寻在网络资源上的负载均衡需求,  高效利用如下的网络基础设施. TCP detects and responds to current network conditions using a variety of feedback mechanisms and algorithms. The mechanisms and algorithms have evolved over the years but the core principles remain the same: ++ All TCP connections begin with a three-way handshake that introduces latency and makes TCP connection creation expensive ++ TCP slow-start is applied to every new connection by default. This means that connections can’t immediately use the full capacity of the link. The time required to reach a specific throughput target is a function of both the round trip time between the client and server and the initial congestion window size. ++ TCP flow control and congestion control regulate the throughput of all TCP connections. ++ TCP throughput is regulated by the current congestion window size.
  • Congestion – this occurs when a link or node is loaded to the point that its quality of service degrades. Typical effects include queuing delay, packet loss or blocking of new connections. As a result, an incremental increase in offered load on a congested network may result in an actual reduction in network throughput. In extreme cases, networks may experience a congestion collapse where reduced throughput continues well after the congestion-inducing load has been eliminated and renders the network unusable. This condition was first documented by John Nagle in 1984 and by 1986 had become a reality for the Department of Defense’s ARPANET – the precursor to the modern Internet and the world’s first operational packet-switched network. These incidents saw sustained reductions in capacity, in some cases capacity dropped by a factor of 1,000! Modern networks use flow control, congestion control and congestion avoidance techniques to avoid congestion collapse. These techniques include: exponential backoff, TCP Window reduction and fair queuing in devices like routers. Packet prioritization is another method used to minimize the effects of congestion.

最佳实践

Geode systems are often called upon to handle extremely high transaction volumes and as a consequence move large amounts of traffic through the network. As a result, one of the primary design goals in architecting a Geode solution is to maximize network throughput.

Best practices for achieving this goal include:

  • 检测和响应了当前的网络条件, 使用几种反馈机制和算法. 机制和算法是经年累月形成的, 但是核心的原理是不变的: 
    ++ 所有的 TCP 连接使用三次握手开始, 这就引入了延时和 TCP 连接创建开销 
    ++ 默认情况下, TCP 慢启动被应用到每一个新建连接. 这就意味着连接并不会立即使用链路层的全部容量. 需要达到一个特定的吞吐量状态所需的时间=客户端服务器之间环回时间+初始化拥塞 窗口大小. 
    ++ TCP 流控和拥塞控制调节所有 TCP 连接的吞吐量. 
    ++ TCP 吞吐量通过当前的拥塞窗口大小来管理.
  • 拥塞 – 当一个链路或节点被加载到这个点时, QoS 性能降级, 此时拥塞就会发生. 典型的影响包括队列延迟, 包丢失或新的连接阻塞. 结果, 在一个拥塞网络上累计增加的负载可能导致网络吞吐量的丧失. 在极端情况下, 网络可能遭遇一个拥塞崩溃,  在拥塞负载消除之后, 吞吐量又恢复了正常,  使得网络不可用. 这种情况初次被John Nagle 在 1984 年提出, 到了 1986 年, DoD 的 ARPANET 已经遇到了这种情况– 互联网的鼻祖, 世界第一个包交换网络. 这些问题使得网络能力持续下降, 在一些场景下, 网络吞吐量下降了1000倍! 现代网络使用了流控, 拥塞控制, 和拥塞避免技术来避免拥塞崩溃. 这些技术包括: 潜在补偿, TCP Window 减少 , 公平队列设备如 路由器. 包优先级是另外一个方法用于最小化拥塞的影响.

最佳实践

Geode 系统经常调用来处理高通量事务流量, 通过网络流入大量的流量. 结果, 那么 Geode 架构主要的设计目标就是最大化网络吞吐量.

达到这一目标的最佳实践如下:

  • 增加 TCP’s 初始拥塞窗口 – 一个大的开始拥塞窗口允许 TCP 传输更多的数据, 显著增强了窗口的增长 – 对于突发的短时连接, 这是一个特别关键的优化Increasing TCP’s Initial Congestion Window A larger starting congestion window allows TCP transfers more data in the first round trip and significantly accelerates the window growth – an especially critical optimization for bursty and short-lived connections.
  • Disabling TCP Slow-Start After Idle Disabling slow-start after idle will improve performance of long-lived TCP connections, which transfer data in bursts.
  • Enabling Window Scaling (RFC 1323) Enabling window scaling increases the maximum receive window size and allows high-latency connections to achieve better throughput.
  • Enabling TCP Low Latency Enabling TCP Low Latency effectively tells the operating system to sacrifice throughput for lower latency. For latency sensitive workloads like Geode, this is an acceptable tradeoff than can improve performance.
  • Enabling TCP Fast Open Enabling TCP Fast Open (TFO), allows application data to be sent in the initial SYN packet in certain situations. TFO is a new optimization, which requires support on both clients and servers and may not be available on all operating systems.

...