In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what are the skills to improve the development performance of Web". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Use reverse proxy server (Reverse Proxy Server) to accelerate and protect the application.
Its function is mainly in the following three aspects:
Load balancing-load balancers running on reverse proxy servers balance transmission between different servers. Through it, you can make undifferentiated server additions.
Save static files-for direct file requests, such as picture files or code files, they can be stored directly in the reverse proxy server and then sent directly to the user. as a result, the program performance can be improved by quickly accessing and offloading the application server.
Security-reverse proxy servers can be configured with a high degree of security and can identify and monitor threats.
2. Add a load balancer
Adding a load balancer to the site is a relatively simple change, but it can lead to good performance and security improvements. The role of the load balancer is to transport and distribute between different servers.
The load balancer is implemented on the premise that there is a reverse proxy server that sends requests to other servers after receiving Internet traffic. The beauty of the balancer is that it supports two or more application servers and uses a selection algorithm to segment requests between servers.
3. Cache static and dynamic content
The use of caching technology enables content to be presented to users more quickly, and its processing strategies include: faster processing of content when demand is issued, storing content on faster devices, or making content closer to users.
4. Data compression
Compression technology is a huge potential performance accelerator. Its main role is reflected in the picture, video or audio and other files, can be efficiently compressed.
5. Optimize SSL/TLS access
Although SSL/TLS is becoming more and more popular, its impact on performance should also be taken seriously. Its impact on performance is mainly reflected in two aspects:
Whenever a new connection is opened, it is inevitable to initialize the handshake, that is, the browser needs to use HTTP/1.X to establish a server connection every time.
The encrypted data stored on the server will become larger and larger, and users will need to decode it when they read it after encryption.
So how to deal with it?
Session caching-use ssl_session_cache to directly cache parameters for establishing a new SSL/TLS connection
Session ID-the ID / ID of the specified SSL/TLS is stored, but when a new connection is established, it can be accessed directly, thus eliminating the hassle of re-establishing communications.
OCSP stapling Optimization-reduces the time it takes to establish communications by grabbing SSL/TLS authentication information.
6. Deploy HTTP/2 or SPDY
For sites that have enabled SSL/TLS, the combination of HTTP/2 and SPDY will achieve a strong combination of performance; as a result, the establishment of a single connection requires only a communication handshake. The main feature of SPDY and HTTP/2 is that they use a single connection instead of multiple connections.
7. Update the software version regularly
8. Optimize Linux performance
For example, configure or process Linux as follows:
1) Backlog queue
If you have some connections that will be deactivated, consider adding net.core.somaxconn.
2) File descriptor
NGINX allows a maximum of two file descriptors per connection. If your system serves multiple connections, you may need to consider increasing the value of sys.fs.file_max.
3) instantaneous port
When used as a proxy, NGINX creates a temporary ephemeral port for each upstream server. So you can try to increase the value of net.ipv4.ip_local_port_range to increase the number of ports available.
9. Optimize the performance of Web server
1) access log optimization
In NGINX, the buffer=size parameter is added to the access_log to realize the cache writing of the log, and the flush=time is added to realize the cache content writing after a certain time interval.
2) caching
Enabling caching makes the connection respond faster.
3) active client connection
Active connections reduce the number of reconnections, especially if SSL/TLS is enabled.
4) Upstream active connection
A Upstream connection refers to a connection to a program server, database server, etc.
5) restrict access to resources
Adopting appropriate policies to restrict resource access can improve performance and security.
6) perform worker processing
The Worker processing mode is the request-driven processing mode. NGINX uses an event-based model and OS dependency mechanism to distribute requests effectively.
7) perform socket sub-table
The Socket subtable can create an socket listener for each worker process, and when the core delegate connection is assigned to the listener, you can immediately know which processing is about to be performed, thus making the process concise.
8) Thread pool processing
Any computer thread can hang due to a single slow operation. For web server software, disk access is a performance bottleneck, such as data replication and other operations. When using a thread pool for processing, you can put some slow-responding operations into a task group separately so that other operations are not affected.
10. Real-time monitoring to quickly resolve problems and bottlenecks
The implementation of real-time monitoring can fully grasp the operation of the system, find and solve problems, and even find out the causes of performance bottlenecks or slow operation.
For example, the following problems can be monitored:
Server downtime
Connection access lost
Serious cache loss on the server
This is the end of the content of "what are the skills to improve the development performance of Web". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.