: This article mainly introduces the abstract of reading notes. if you are interested in the PHP Tutorial, you can refer to it. Differences between nginx and apache. Nginx static compilation module, apache dynamic and static compilation, so files need to be loaded in the configuration module
Nginx installation package small apache installation package relatively large
The processing speed of apche is very slow, occupying a lot of memory resources.
Nginx load balancing algorithm
Round robin is allocated in order, and the machine is automatically kicked off when it crashes.
Weights are assigned to backend servers based on their assigned weights.
Ip-HASH is automatically allocated based on hash results and used with weights
Fair intelligently allocates traffic to machines based on the page loading speed and backend server speed
User request process
Server-location-upstream
Nginx + fastcgi
Nginx sends a cgi request to sock and starts fastcgi. warperr accepts the request and derives a thread to call the interpreter.
Comparison between varnish and squid
Varnish is from memory and squid is from hard disk. Varnish is more efficient
Varinish is more stable than squid
Once varnish crashes, the cached data will be released from the memory and requests will be sent directly to the backend server.
The lvs dr mode must be in a broadcast domain. if it is not in a broadcast domain, rs cannot receive packets forwarded by lvs and disable route forwarding.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above section introduces the reading notes, including some content, and hopes to help those who are interested in the PHP Tutorial.