Why is the performance of Nginx much higher than that of Apache?
This is due to Nginx using the latest epoll (Linux 2.6 kernel) and kqueue (freebsd) network I/O model, Apache, on the other hand, uses the traditional select model. At present, Squid and Memcached, which can withstand high concurrent access under Linux, all use the epoll network I/O model. To deal with the read and write of a large number of connections, the select network I/O model adopted by Apache is very inefficient. Let’s use a metaphor to analyze the difference between the select model adopted by Apache and the epoll model adopted by Nginx: Suppose you are studying in a university, and there are many rooms in the dormitory building where you live, and your friends want to come to you. The dormitory aunt in the select version will take your friends to search from room to room until they find you. The dormitory aunt of the epoll version will first write down the room number of each student, When your friends come, you only need to tell your friends which room you live in, instead of taking your friends all over the building to find someone. If 10,000 people come and they all want to find their classmates who…