Loadbalance

load balance

把一系列task分给不同的机器。

  • 静态
    • it does not take into account the state of the system for the distribution of tasks
    • are easy to set up and extremely efficient in the case of fairly regular tasks
  • 动态
    • take into account the current load of each of the computing units
    • tasks can be moved dynamically from an overloaded node to an underloaded node in order to receive faster processing

proxy

  • Client-side random load balancing: deliver a list of server IPs to the client, and then to have client randomly select the IP from the list on each connection

    • the method of delivery of list of IPs to the client can vary
  • Server-side load balancers

    • The load balancer forwards requests to one of the "backend" servers
    • load balancers are implemented in high-availability pairs which may also replicate session persistence data if required by the specific application
  • presistence

    • important issue when operating a load-balanced service is how to handle information that must be kept across the multiple requests in a user's session.
    • One basic solution to the session data issue is to send all requests in a user session consistently to the same backend server.
    • Assignment to a particular server might be based on a username, client IP address, or be random.
    • use memcache to save session info
    • a simple but efficient approach is to store the per-session data in the browser itself: cookie
      • or URL rewriting

forward

前向代理作为客户端的代理,将从互联网上获取的资源返回给一个或多个的客户端,服务端(如Web服务器)只知道代理的IP地址而不知道客户端的IP地址 Forward proxies ensure that websites never communicate directly with a user

reverse

反向代理是作为服务器端(如Web服务器)的代理使用,而不是客户端。反向代理是供很多客户端都通过它间接访问不同后端服务器上的资源,而不需要知道这些后端服务器的存在,而以为所有资源都来自于这个反向代理服务器。 reverse proxies ensure that users would not communicate directly with a back-end server.

A reverse proxy server is a type of proxy server that typically sits behind the firewall in a private network and directs client requests to the appropriate backend server. A reverse proxy provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.

DNS

  • round-robin DNS: multiple IP addresses are associated with a single domain name
  • DNS delegation: delegate www.example.org as a sub-domain whose zone is served by each of the same servers that are serving the web site. This technique works particularly well where individual servers are spread geographically on the Internet.