[Xidapuben] JFrog supports P2P download function

  1. Requirement background
    In a large-scale Docker container runtime environment, if there are a large number of image instances, the images need to be updated on a large scale and in multiple places at the same time. For example, when a large e-commerce platform needs to update the images of all containers, the Docker image center often becomes a performance bottleneck. This bottleneck often comes from the network outlet of the mirroring center. For example, if the host where the mirroring center is located has a 10G network card, the network traffic will be limited to 1000MB (note that it is a large byte). Usually this network card will be shared by multiple applications, so the traffic is A lot of losses make it impossible to meet the needs of real-time distribution of Docker images. Even if the Docker mirror center is deployed in a remote location, it is difficult to meet the instantaneous concurrent pull traffic, which causes the Docker to fail to pull the mirror and the Pod cannot be started.
    2. Function introduction
    In order to solve this problem, JFrog Artifactory E+ 7.9 version supports P2P function. The previous image pull method is as follows: After
    [Xidapuben] JFrog supports P2P download function
    supporting P2P, the image distribution method is as follows:
    [Xidapuben] JFrog supports P2P download function
    JFrog P2P function allows users to directly obtain products from the Peer network. The Peer node stores seed products and cached products, thereby greatly reducing Artifactory's Download pressure.
    The architecture of JFrog P2P module:
    • Tracker: is an Artifactory service used to broadcast and track which peers and servers the available seed products are.
    • Peer: It is a unique JFrog application that is deployed on the host of the peer node to communicate with other peer nodes. Peer nodes connect to Tracker to download products, and declare the availability of seeds to Tracker.
    • P2P Swarm: It is a logical collection of peers nodes, which forms a distributed network for sharing products with Docker clients in the cluster.
    • Client: The client software user interacts with the peer, usually Docker or HTTP client.

JFrog P2P download workflow:

  • Peer is installed on a host connected to Artifactory, such as a Kubernetes work node.
  • Peer nodes connect to Artifactory Edge and then register on Trakcer to provide services as a seed server. All downloads are encrypted by SSL and use Artifactory's chain authentication for unified authentication. Peer nodes listen to download requests from clients or other Peer nodes.
  • After the Peer node downloads the seed file, it will automatically broadcast its content to each Tracker, and the Tracker will store the information of these seed files. 
  • When the Peer node listens to the client request, it will go to the Tracker to check which Peer nodes have cached the file, the Tracker will reply to the request of the Peer node, and then the Peer node will start to download from these nodes in the Peer swarm.
  • When the file is cached on the peer node, this information will be discovered and broadcast by the tracker, and it can be pulled by other peer nodes concurrently. The download process is multi-threaded concurrent execution, so it can fill up the network bandwidth inside the Peer cluster, making the download speed faster than downloading from the Artifactory server.

3. Benefits
Through the P2P function, users can quickly pull images to achieve business continuity. This function is currently supported in the JFrog E+ version. Everyone is welcome to download and try for free.

Guess you like

Origin blog.51cto.com/jfrogchina/2546506