one, the Web application Chapter
1 HTTP Server Nginx
1.1 Performance, functionality, installation vs. Apache
• Less system resources on performance, high concurrency support
L Functional Reverse proxy server and load balancer server
• Easy installation and configuration
The advantages of 1.2 Nginx
Web server: Processing static files, index files, automatic indexing efficiency
L Implement Cache-free response agent acceleration
• Load Balancing
L High concurrency (50000vuser) and low memory consumption
L Security Nginx maintains 10,000 inactive connections (up to 2.5M of memory) for DOS attacks
L Hot Deployment Configuration upgrade no reboot required
1.3 The difference between a forward proxy and a reverse proxy
The typical use of a forward proxy is to provide access to the Internet for LAN clients within the firewall.
The typical use of the reverse proxy is to provide access to the Internet user to the server behind the firewall. The reverse proxy can also provide load balancing for multiple servers in the backend, or provide buffering services for servers with slower back-end.
1.4 Performance Optimization
L Cancel Debug Mode (18 pages)
Nginx source code After decompression, modify the AUTO/CC/GCC file
#debug
Cflags= "Gflags-g"
Comment or delete these two lines, i.e. cancel debug mode
L Tcmalloc
Related article: http://www.linuxidc.com/Linux/2013-04/83197.htm
L nginx Kernel parameter optimization (21 pages)
Related article: http://www.linuxidc.com/Linux/2013-04/83198.htm
1.5 Building Nginx + Java Environment (32 pages)
L A quiet move
Give the static request to Nginx, the dynamic request to the backend Tomcat
• Load Balancing
Nginx load balancer with load balancing function for multiple tomcat servers
2 HTTP Accelerator varnish
Advantages of 2.1 varnish
L reverse Proxy Server and HTTP accelerator
Based on memory cache, data disappears after reboot
Using virtual memory mode, IO performance is good
0-60s Exact Cache time
VCL Configuration Management Flexibility
32G Max Cache 2GB
Powerful management features (top stat admin list)
Clear State structure
Binary heap Management cache file
2.2 Compared to Squid
L are open source reverse proxy Server
L Varnish stability above squid
L varnish access faster, directly from memory
L support more concurrent connections, TCP connection release faster than squid
• Bulk purge of partial caches using regular expressions through the management port
L Cons: High concurrency cpu/io/memory overhead is higher than squid
• Once the varnish process is suspended, crashed, or restarted, the cached data is completely released, and all requests are sent to the backend server, causing great pressure on the back-end server.
2.3 Varnish Optimization
• Linux kernel optimization (58 pages)
L System Resource Optimization (59 pages)
Ulimit
L Varnish parameter Optimization (61 pages)
3 memcached Applications
second, operation and maintenance monitoring and performance optimization
1 operation and Maintenance monitoring tool Nagios
1.1 Nagios Features
L low cost, simple structure, strong maintainability
L can run on Linux, UNIX platform, while providing web interface to monitor multiple hosts or service running status
L Monitor local and remote host resources (memory, process, disk, etc.)
L can monitor Network Service resources (HTTP/PING/FTP/SMTP/POP3, etc.)
L Allow users to write custom plugins to monitor specific services
L Abnormal alarm (mail, SMS)
• Custom event handlers that automatically invoke the specified handler when a host or service fails
1.2 Download Install Nagios (Http://yunpan.cn/cgEJDs6uvetyn extract code 7AD9)
Installation package: Nagios-3.2.0.tar (217 pages)
Plugin: Nagios-plugins-1.4.14.tar (218 pages)
Chinese: Nagios-cn-3.2.0.tar (218 pages)
Apache:httpd-2.0.63.tar (219 pages)
Php:php-5.3.2.tar (219 pages)
./configure--prefix=/usr/local/php--with-apxs=/usr/local/apache2/bin/apxs--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2
Cond.....
High-performance Linux Server Building practical notes