Javaweb Web site performance optimization related technology __java

Source: Internet
Author: User
Tags http redirect website performance
the related technology of Javaweb website performance optimization

First, improve the server concurrent processing capacity

We always want a server to be able to process more requests per unit of time, which is the key to the ability of the Web server. The server can handle multiple requests at the same time, because the operating system is designed through a multiple execution flow system, allowing multiple tasks to take turns using system resources, including CPU, memory, and I/O. This requires selecting an appropriate concurrency policy to make reasonable use of these resources to improve the concurrency processing capabilities of the server. These concurrency strategies are more widely used in the underlying Web server software, such as Apache, Nginx, and lighttpd.


Second, Web Component separation

The Web Components described here are all URL-accessible resources provided by the Web server, including dynamic content, static Web pages, images, stylesheets, scripts, videos, and so on. These resources in the file size, the number of files, content update frequency, the estimated number of concurrent users, whether the need for a script interpreter and so on are very different, the use of resources to the various characteristics of the full use of its potential optimization strategy, can greatly improve the performance of the Web site. For example, to deploy a picture on a separate server and assign it a separate new domain name, using the Epoll model for static Web pages can maintain a stable throughput rate in large concurrency.

Third, the database performance optimization and expansion.

The optimization of Web server software in database is mainly to reduce the number of accesses to the database, by using various caching methods. It is also possible to improve the query performance from the database itself, which involves the knowledge of database performance optimization, which is not discussed in this paper. In addition, it can expand the database scale and improve the database service ability by the way of master-slave copying, read-write separation, using reverse proxy, write-operation separation and so on.


Iv. Web load balancing and related technologies

Load balancing is a means of expanding the scale of Web site, and several methods of load balancing include load balancing based on HTTP redirection, DNS load balancing, reverse proxy load balancing, four layer load balancing and so on.


A simple introduction to these load balancing methods: Load balancing based on HTTP redirection uses the HTTP Redirect request transfer and Automatic jump function to achieve load balancing, which is used by our familiar mirror downloads. DNS load balancing refers to the configuration of multiple IP addresses for the same host name in a DNS server, and the return of different parsing results when replying to DNS queries, which leads clients to different machines, enabling different clients to access different servers to achieve load balancing purposes. Reverse proxy load Balancing is also called seven-tier load balancing, because the reverse proxy server works in the seventh layer of the TCP seven-layer structure (application layer), which performs load balancing tasks based on the information in the header by examining the HTTP headers that flow through. The four-layer load balancing is a load balance based on NAT technology, which maps a legally registered IP address on the Internet to the IP address of multiple internal servers and dynamically uses one of the internal IP addresses for each TCP connection request to achieve load balancing. In addition, there is a load balancing work in the direct routing mode of the data Link layer (second layer), which is implemented by modifying the packet target MAC address. As well as the load balance based on IP tunnel, in this way, the actual server can be deployed in different regions according to the need, and the request is transferred according to the principle of the nearest access, CDN Service is based on the IP tunneling technology.


Web load Balancing provides a larger, more complex, and more flexible platform for optimizing Web site performance while extending the size of the Web server, including shared file systems, content distribution and synchronization, distributed file systems, distributed computing, distributed caching, and so on.


Five, Web caching technology

Web caching technology is considered to be an effective way to reduce server load, reduce network congestion and enhance the scalability of the World Wide Web, and its basic idea is to use the time locality (temporal locality) principle of customer access to store a copy of the content that the customer has visited in the cache. When the content is accessed next time, it is not necessary to connect to the hosting site or recalculate the build, but to provide it by the copy kept in the cache. Web caching can offer the following benefits:


(1) Reduce network traffic, thereby reducing network congestion; This is because the cache avoids part of the HTTP request.

(2) Reduce customer access delays, the main reasons are as follows: ① the cached content, the customer can cache fetch rather than obtain or recalculate the generation from the server, thereby reducing the transmission delay and shortening the response time; ② not cached content can be quickly obtained by customers due to network congestion and reduced server load;

(3) because some or all of the customer's request content can be obtained from the cache, thereby reducing the load on the remote server.

(4) If the server fails to respond to customer requests due to a server failure or network failure, the client can obtain a cached copy of the content from the cache, making the Web site service robustness (robustness) enhanced.


You can see that Web caching can bring significant performance improvements to your Web site. In fact, when a user makes a request to a full web page rendering in front of the user in the process of caching everywhere, the following is the Web performance optimization of the common caching technology, you will find that the cache is widely used in all aspects.


Browser caching: Browsers typically create a directory in the user's file system to store cached files and to mark each cached file with the necessary tags, such as expiration times. These tags are used primarily for caching negotiation between browsers and servers.


Web server caching: a URL for a longer period of time corresponding to a unique response content, such as static content or update less frequent dynamic content, the Web server can cache the response content, the next Web server can be received immediately after the request to cache the response content and return to the browser.


Proxy Server caching: Exposed to the Internet the front-end server connected to the back-end Web server through the internal network is called the reverse proxy server, and the cache built on the reverse proxy server is called the reverse proxy cache. Exposed to the Internet the front-end server connected to the backend Web client through the internal network is called the forward Proxy server, and the cache built on the forward proxy is called the forward proxy cache. Proxy server caching is between the client and the Web server and can be viewed as a relay station between the two. It can improve the access speed of the client, improve the service capability of the Web server, security, and so on.

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.