Javaweb application of common faults and treatment methods

Source: Internet
Author: User
Tags xms

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.