Improve web server response speed by pure software

zhaozj2021-02-16  69

Improve web server response speed by pure software

http://91mail.51.net

?

Abstract: This paper proposes a solution to improving the web server response speed by pure software. This solution has the advantages of low hardware cost, safe, efficient, and expounds its principles and application prospects by comparison with common schemes.

Abstract: This paper presents optimistic solution that increases the speed that WEB server respond with with the pure software method, this solution has the hardware expenses low, safety, wait the advantage efficiently, and pass with the comparison of the in common use solution expatiated its Principle with apply the foreground.

Keywords: PHP, MySQL, Apache, FreeBSD UNIX

CLC number: TP3 ???? literature sign identification code B

1 Introduction

??? I have set a website based on the Apache web server running on the UNIX server. In the early stages of design, we have a bold solution for improving the speed of the web server, but we have a bold solution, but based on system security and The stability is considered, and finally does not use this solution. However, we feel that this idea has a big role in improving the reflection of the web server, and if you can make a set of integration based on this envision with a certain amount of time, it will greatly improve the reflection speed of the web server. Now we have already implemented this scheme with this scripting language.

2 The origin of the program

This website is a comprehensive site about tourism, including tourist scenic spots, attractions, hotels, private specialty, folk customs, etc., according to user requirements: background database management module, front-end display module, Registered User Management Module. Registered users can log in to the website at any time location to reflect the latest scenic area dynamics, such as the newly opened several tourist attractions, specialty products, etc.

Since all media information in the web page is based on the MySQL database, all media information in the web page includes text, pictures, video files, etc., are stored in the database. When the viewer is accessible, all pages are generated, style, and style with PHP program control, so The response speed of the web server is slow (of course, the response speed is directly related to the performance of the hardware, but when the hardware condition cannot be improved, it can also be used to make up for software). How to solve this problem? The author is studying a set of file operation functions in PHP, and wants to write a class regarding file operations, so I think that I can't make a static page, accurately say to generate a folder, including an HTM file, and the page embedded Pictures and video files, then place the path to the HTM file into the MySQL database. This way the user requests a static page, and a generation can make the user countless times, rather than the user access time. This can reduce the burden of the MySQL database, but also improve the response speed of the web server. So we propose the principle of this program, see the schematic Figure 1 for details. Among them, ellipse and circle represent objects or groups, rectangular representative functional modules.

3? The principle of this program

First let's take a look at the two schematic, the principle Figure 1, is our proposed program, the schematic of the current map 2. Comparison Schematic Figure 1 and Schematic Figure 2, you will find the schematic Figure 1 More than one file object is more than the schematic, this is the key difference between the two programs, this file object is actually big data blocks such as pictures, a lot of text, Videos, etc. carriers. When the administrator of each scenic spot has been registered with the user login, they submit the scenic information such as text, pictures, videos, etc., and the user management module generates the corresponding files to the corresponding directory, and generates a fixed style. The webpage and convert the corresponding directory into the network path to the MySQL database. A picture, text, video, etc. of the respective scenic spots are shown in the page generated page. The display module can be called as long as the corresponding path is called in the database. The background management module is mainly used by the website management personnel. ?

4 Comparison of common programs and this program

?? For security considerations, most websites are used in the second solution, but the first program we have not found a way to attack it. The following is a few aspects to compare both solutions.

Hardware cost: To achieve the same response speed, the hardware program 2 is more than a few more or more of the funds than the plan 1.

Software costs: Software of Solution 1 is more difficult than the writing of program 2, but in general, the solution 1 is much less than the hardware investment of the program 2.

Safety and Stability: Scheme 1 may (I can't prove that this program is absolutely safe) is not as safe and stable. Since the scheme 1 involves a file operation.

In general, program 1 is more suitable for SMEs or education websites, can save funds, and program 2 is a must for large business sites.

5 Analysis of the safety of the first program

The weakness of the program 1 is its file operation, and there is a malicious person (hereinafter referred to as hacker) will have the following opportunities to attack the website implemented in scheme 1.

(1) ??? Submit malicious code. Registered users can submit a large number of words, and hackers will embed the code written by themselves into the text and submit it to the website. Because the program 1 is saved as a file, hackers can directly access this file to perform their malicious code.

(2) ??? Submit malicious documents. The malicious code file is uploaded as the image, then execute, the method (1) requires more techniques.

(3) ??? Use some software to detect the system users and passwords on the UNIX system, and then log in with this user.

How to prevent (1) attack? We filled with marks in the WEB program such as "<", ">", etc. in the PHP program, the code submitted by the hacker could not be executed, and the name of the file we generated was random, hackers could not find the files you submitted at all. For (2) attack, we store the image files do not extension, and the name is not named according to the name provided by the user, and is also randomly generated. In case of preventing case, we analyze the type of image files, and limit the type and size of the picture, can only be BMP and JPG format. Therefore, the chance of success of hackers is almost equal to zero.

For (3) attacks, until now, we still don't know how to crack the system user password, and if you don't know the name of this system user, if there is such a skill, then their attack Objects should not be these small websites.

?

6 Conclusion

In summary, we believe that the programs 1 are a high cost-effective solution for a small and medium-sized enterprise website, which should be better promoted and utilized.

?

?

?

转载请注明原文地址:https://www.9cbs.com/read-14933.html

New Post(0)