Preface:If you are lucky to be seen by a friend and find something wrong in this article, you may want to criticize and correct it. If you have any questions, we hope you can discuss them together.
How varnish works
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4A/56/wKiom1QkQ-GBDNqHAAEEoemP03Q686.jpg "Title =" Figure 1 "alt =" wKiom1QkQ-GBDNqHAAEEoemP03Q686.jpg "/>
As shown in: varnish is similar to General server software, which can be divided into Master process and child process. The master process reads the storage configuration file, calls the appropriate storage type, creates/reads cache files of the corresponding size, and then the master initializes the structure for managing the bucket, then fork and monitors the child process. During the initialization of the main thread, the child process maps the previously opened storage file to the memory. At this time, the space structure is created and initialized and mounted to the storage management structure to be allocated. The child process allocates several threads for work, including several management threads and multiple worker threads.
Varnish Workflow
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4A/59/wKioL1QkR0CiEotsAAUy3oMCLMA694.jpg "Title =" Figure 2 "alt =" wkiol1qkr0cieotsaauy3omclma694.jpg "/>
Simple varnish application architecture Topology
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4A/58/wKiom1QkTszRjaMnAAGn4OZpyuM876.jpg "Title =" Figure 3 "alt =" wkiom1qktszrjamnaagn4ozpyum876.jpg "/>
To be continued...
Varnish-Cache: high-performance reverse proxy cache server and HTTP accelerator