java high concurrency processing

Java high concurrency processing


1. The basic solution focuses on the following aspects: the use of high-performance servers, high-performance databases, high-efficiency programming languages, and high-performance Web containers. (To a certain extent, it also means greater investment, with bottlenecks, and no good scalability)


From the perspective of low cost, high performance and high scalability, some of my experiences:
1. HTML is static :( Static as much as possible, and then static again when updating)
Information publishing system CMS information publishing system can realize the simplest information entry and automatically generate static pages, and can also have functions such as channel management, rights management, automatic grabbing, etc., for a large-scale For websites, having an efficient and manageable CMS is essential.

2. Separation of image servers: (images are on other servers, reducing the request pressure of page servers)
For web servers, whether it is Apache, IIS or other containers, images are the most resource-consuming, so it is necessary for us to associate images with pages. Separation is basically a strategy used by large websites. They all have independent image servers, or even many image servers. Such an architecture can reduce the pressure on the server system that provides page access requests, and can ensure that the system will not crash due to image problems. Different configuration optimizations can be performed on the application server and the image server. For example, apache can try to configure ContentType as much as possible. Less support and as few LoadModules as possible ensure higher system consumption and execution efficiency.

3. Database cluster and database table hashing: (using database cluster or database table hashing)

4. Cache (reducing the bottleneck of database access)

5. Mirroring
Mirroring is a way that large websites often use to improve performance and data security. The mirror technology can solve the difference in user access speed caused by different network access providers and regions. For example, the difference between ChinaNet and EduNet has prompted many websites to build mirror sites in the education network, and data are updated regularly or in real time.

6. Load balancing
Load balancing will be the ultimate solution for large websites to solve high-load access and a large number of concurrent requests.

There are two architectures for your reference:


(Java system high concurrency solution): http://blog.csdn.net/jimmy609/article/details/37810591

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326781513&siteId=291194637