The server architecture is:
Nginx+resin+memcached+db
First, the cause of the failure
1. High server load
(1) Sudden increase in traffic volume
(2) Code logic issues
(3) Partial service failure (ATS,DB,MC ... )
Ps:linux server load is typically below 2.
2. Direct Buffer Memory
Direct buffer memory refers to the local application and MC communication area (local buffer), if the MC block is set too large, GC can not be collected in time.
3, a large number of static files occupy resin thread
Resin threads are typically 256
4, JVM configuration is too large, GC time is long, causing a thread jam
General application JVM Configuration 2~2.5g memory, large application configuration of 3G, small application configuration of 1.5G
Ii. measures
1. Separating static files
Js,css,image,xml .... This kind of file jumps directly through Nginx, does not occupy resin thread
2. High-volume pages and interfaces are appropriately statically based on business needs, such as using Nginxpeoxycache or ATS (Apache traffic Server) to reduce the number of resin occupied threads
Client--->ats--->nginx--->nginxproxycache--->memcached--->db
3, avoid the MC block set too large, or a large number of XML file read.
4. Pay attention to the code quality (Development specification)
5, JVM settings, xms,xmx do not set too large, XMM settings are generally xmx/xms 1/3.
Javaweb application of common faults and treatment methods