1. Why do I need Vainish or memcached cache?
• The cache server puts the data in memory, HTTP or MySQL server is the data on the hard disk
• Reading data from memory is faster than reading data from the hard disk
• Users send a request to view the picture, cache the server line to see if there is any, if there is a direct return to the customer, if not go to the HTTP server to find, and then save in local memory in one copy, and then return to the customer a copy
2.nginx and Apache How to handle PHP dynamic page?
Apache uses mod_php module for processing
Nginx Treatment with fastcgi
3. The role of each node
Nginx as a reverse proxy: When users access dynamic content, they are distributed to Apache and access static content to Nginx
Varnish: Received the user request, if not in the cache server, go to the Web server to find, and then first saved on the local server, and then returned to the customer
RABBITMQ Message Queuing: For example, there are 4,000 requests coming in, and the RABBITMQ servers are all cached and allocated according to the processing power of the real server.
· Haproxy load Balancing: Load-balance the Apache real server and set the maximum number of requests per Apache (such as 500) to be processed. 4,000 requests come in, Haproxy set each real server to handle up to 500, RABBITMQ mates Haproxy, so that the backend real server is up to processing location
memcached: Cache Database
Mysql-proxy: To read and write to MySQL, if the reading is transferred to the library, if it is written to the writing library
LVS: Load balancing for MySQL read library
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/71/AE/wKiom1XWnNigKKOLAAMYUQuxX08488.jpg "title=" Schema diagram. jpg "alt=" wkiom1xwnnigkkolaamyuquxx08488.jpg "/>
Schema flow:
The user enters a URL, after DNS resolves the IP address, arrives the enterprise firewall, if accesses is the dynamic content, to the varnish cache server, if, to the RABBITMQ message queue, to Haproxy according to the algorithm to the Apache real server processing, Web server Connection Mysql-proxy if it is written to the write library, if it is read library to Lvs,lvs according to the algorithm to find a database, the database to the Web server, the Web server back to the customer
E-Commerce Architecture design Preliminary (to perfect!!!) )