Chapter 21 Website Tech

21.1 Apache

  • New features in Apache HTTP Server 2.4

互联网创业的准备——web server:apache、nginx、lighttpd与php module、fastcgi

虽然apache httpd 2.4 像nginx一样使用了epoll,但是性能还是比nginx低很多.

21.2 Nginx

There’s one worker process per core to make efficient use of hardware resources, the ability to interleave multiple connections within a single worker process, and the capability to switch from connection to connection almost instantaneously as network traffic arrives. Put this magic together and you create the massively scalable HTTP application delivery engine that is NGINX.

  • How NGINX creates processes to make efficient use of resources
  • The use of state machines to manage traffic
  • The innovative non-blocking, event-driven architecture that allows NGINX to schedule multiple state machines simultaneously
  • How the process architecture supports non-stop, graceful updates and binary upgrades

Rolling upgrade and Socket Sharding.

关于Nginx session sticky



Redis 分布式缓存,是如何实现多台服务器SESSION 实时共享的

21.3 Haproxy

21.3.1 Stickiness

Session 粘连

to maintain a visitor on the same server even across various events such as server addition/removal, down/up cycles, and some methods are designed to be resistant to the distance between multiple load balancing nodes in that they don’t require any replication.

21.4 MongoDB