CN116389442A - Web page request system and method based on load balancing - Google Patents

Web page request system and method based on load balancing Download PDF

Info

Publication number
CN116389442A
CN116389442A CN202310107348.XA CN202310107348A CN116389442A CN 116389442 A CN116389442 A CN 116389442A CN 202310107348 A CN202310107348 A CN 202310107348A CN 116389442 A CN116389442 A CN 116389442A
Authority
CN
China
Prior art keywords
web page
load balancing
request
response
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310107348.XA
Other languages
Chinese (zh)
Inventor
王晓凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Hongji Information Technology Co Ltd
Original Assignee
Shanghai Hongji Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Hongji Information Technology Co Ltd filed Critical Shanghai Hongji Information Technology Co Ltd
Priority to CN202310107348.XA priority Critical patent/CN116389442A/en
Publication of CN116389442A publication Critical patent/CN116389442A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a web page request system and a web page request method based on load balancing, which relate to the field of computer resources, wherein the system comprises a client, a load balancing module and a server; the client is used for sending a web page request message to the load balancing module; the load balancing module is used for sending the request web page message to the server and determining whether the response web page corresponding to the request web page message is compressed or not; the server is used for sending a response web page to the load balancing module after receiving the request web page message; the load balancing module is also used for compressing the response web page and sending the compressed response web page to the web browser of the client when the response web page is determined to be compressed; when the response web page determines that compression is not performed, the response web page is sent to the web browser of the client. The invention reduces the resource consumption of the server.

Description

Web page request system and method based on load balancing
Technical Field
The invention relates to the technical field of computer resources, in particular to a web page request system and a web page request method based on load balancing.
Background
As shown in fig. 2, a web browser on a client initiates a request to a web server; after the web server receives the request, it begins to find the requested web page. After finding, the web browser responds to the client. web servers are typically located on the internet to provide web access services to the public. When the web page returned by the web server is large, a large amount of valuable internet bandwidth is consumed. Especially when a large number of users access simultaneously, bandwidth congestion and exhaustion can be caused, so that bad experiences such as network blocking and the like are caused. And part of the web servers have the function of compressing web pages. However, compressing web pages is a computationally intensive operation, that is, it consumes a lot of server CPU resources, and when a lot of web pages need to be compressed, it causes the web server CPU resources to be exhausted, resulting in a crash.
Disclosure of Invention
The invention aims to provide a web page request system and a web page request method based on load balancing, which reduce the resource consumption of a server.
In order to achieve the above object, the present invention provides the following solutions:
a web page request system based on load balancing comprises a client, a load balancing module and a server; the client is connected with the load balancing module and the server respectively, and the load balancing module is connected with the server;
the client is used for sending a web page request message to the load balancing module;
the load balancing module is used for sending the request web page message to the server and determining whether a response web page corresponding to the request web page message is compressed or not;
the server is used for sending a response web page to the load balancing module after receiving the request web page message;
the load balancing module is further used for compressing the response web page and sending the compressed response web page to the web browser of the client when the response web page is determined to be compressed; and when the response web page is determined not to be compressed, sending the response web page to the web browser of the client.
Optionally, the load balancing module includes a list of compressed web page types; the compressed web page type list is used for storing web page types preset for compression;
the load balancing module is used for assigning a compression identifier corresponding to the request web page message to be 1 when the web page type corresponding to the request web page message exists in the compression web page type list; and when the web page type corresponding to the request web page message does not exist in the compressed web page type list, assigning the compression identifier corresponding to the request web page message to be 0.
Optionally, the load balancing module is configured to compress the response web page by adopting a gzip algorithm.
Optionally, the load balancing module is further configured to send the compression identifier to the client;
and the client is used for decompressing the corresponding compressed response web page and displaying the decompressed response web page through a web browser when the received compression identifier is 1.
Optionally, the load balancing module is connected with a plurality of servers.
The invention also discloses a web page request method based on load balancing, which comprises the following steps:
the client sends a web page request message to the load balancing module;
the load balancing module sends the request web page message to the server and determines whether a response web page corresponding to the request web page message is compressed or not;
the server sends a response web page to the load balancing module after receiving the request web page message;
the load balancing module compresses the response web page when the response web page is determined to be compressed, and sends the compressed response web page to the web browser of the client; and when the response web page is determined not to be compressed, sending the response web page to the web browser of the client.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
the invention determines whether the response web page corresponding to the request web page message is compressed or not through the load balancing module, compresses the response web page when the response web page is determined to be compressed, and sends the compressed response web page to the web browser of the client, namely, the load balancing module shares the resource consumption of the web server (server), thereby reducing the resource consumption of the server.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings that are needed in the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a web page request system based on load balancing according to the present invention;
FIG. 2 is a schematic diagram of a connection between a web browser and a server in the prior art;
FIG. 3 is a schematic diagram of a web page request system workflow based on load balancing in accordance with the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention aims to provide a web page request system and a web page request method based on load balancing, which reduce the resource consumption of a server.
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Currently, users (clients) are directly connected to a web server, and if the web server is down, the users naturally have no way to access. In addition, if many users attempt to access the server at the same time, the limit that they can handle is exceeded, there may be situations where the loading speed is slow or no connection at all. The present invention can alleviate this failure by introducing a load balancer (load balancing module) and multiple additional web servers. Typically, all backend servers will be guaranteed to provide the same content so that the user can receive consistent content regardless of which server responds. Additional multiple web servers may also share the load, relieving individual web servers of stress, and thus handling more user requests.
Example 1
As shown in FIG. 1, the web page request system based on load balancing comprises a client, a load balancing module and a server; the client is connected with the load balancing module and the server respectively, and the load balancing module is connected with the server.
The workflow of the web page request system based on load balancing is shown in figure 3.
The client is used for sending a web page request message to the load balancing module.
The load balancing module is used for sending the request web page message to the server and determining whether the response web page corresponding to the request web page message is compressed or not.
The server is used for sending a response web page to the load balancing module after receiving the request web page message.
The load balancing module is further used for compressing the response web page and sending the compressed response web page to the web browser of the client when the response web page is determined to be compressed; and when the response web page is determined not to be compressed, sending the response web page to the web browser of the client.
According to the invention, the web page compression module is added in the load balancing module, and the compression operation is carried out on the web page of the specified type, so that the purposes of saving the Internet bandwidth resource and reducing the pressure of the web server are achieved.
The load balancing module comprises a compressed web page type list; the compressed web page type list is used for storing web page types preset for compression.
In the configuration page of the load balancing module, the web page types needing to be compressed are configured by compressing the web page type list, and the web page types are as follows: * Html/. Js/. Txt/. Css.
The load balancing module is used for assigning a compression identifier corresponding to the request web page message to be 1 when the web page type corresponding to the request web page message exists in the compression web page type list; and when the web page type corresponding to the request web page message does not exist in the compressed web page type list, assigning the compression identifier corresponding to the request web page message to be 0.
The load balancing module is used for compressing the response web page by adopting a gzip algorithm.
The load balancing module is further configured to send the compression identifier to the client.
And the client is used for decompressing the corresponding compressed response web page and displaying the decompressed response web page through a web browser when the received compression identifier is 1.
The load balancing module is connected with a plurality of servers. Each server provides the same content, relieving the individual web servers of stress, and thus handling more user requests.
The load balancing device adopted by the load balancing module can be software or special hardware equipment.
Wherein the software load balances the open source of the ngix (https:// www.nginx.com /).
The professional hardware load balancing providers are: f5 (https:// www.f5.com /) and Hongdi technology, F5 is a United states corporation.
Today, slightly scaled websites (including shopping websites and ticketing websites, etc.) must use load balancing techniques, smaller scale websites may use software load balancing, and larger websites may use specialized hardware load balancing.
The server (web server) refers to a website server generally, refers to a program of a certain type of computer residing on the Internet, can process requests of web clients such as a browser and return corresponding responses, and can also place website files for browsing worldwide; data files may be placed for worldwide download.
The web page refers to a page file returned to the client by the web server for analysis by a browser of the client and display to a user.
The invention discloses a workflow of a web page request system based on load balancing, which comprises the following steps:
step1, the web browser of the client accesses the load balancing module and sends a request for a web page (webage1.html) to the load balancing module.
And Step2, after the load balancing module receives the request, judging the type of the requested web page. According to the pre-configuration, it is determined whether the requested response web page requires a compression operation.
Step3, the load balancing module forwards the request of the client to the back-end web server.
Step4, the web server returns a response page to the load balancing module. This response web page (webage1. Html response web page) contains content that needs to be compressed. The content to be compressed includes: pictures, audio and video, text and the like to be displayed on the web browser.
Step5, according to the judging result of Step2, if the web page needs to be compressed, the web page is compressed. Replacing the response web page with the compressed content after compression; if the page does not require a compression operation, it is forwarded directly to the client.
Step6, adding a Content-encoding:gzip field in the HTTP response. This field indicates that the current response page data is compressed by the gzip algorithm, and the web browser recognizes this field and decompresses the data. And then forwarding the compressed response page to the client.
Example 2
The invention also discloses a web page request method based on load balancing, which is applied to the web page request system based on load balancing described in the embodiment 1.
The client sends a request web page message to the load balancing module.
The load balancing module sends the request web page message to the server and determines whether the response web page corresponding to the request web page message is compressed.
And the server sends a response web page to the load balancing module after receiving the request web page message.
The load balancing module compresses the response web page when the response web page is determined to be compressed, and sends the compressed response web page to the web browser of the client; and when the response web page is determined not to be compressed, sending the response web page to the web browser of the client.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. For the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the system part.
The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to assist in understanding the methods of the present invention and the core ideas thereof; also, it is within the scope of the present invention to be modified by those of ordinary skill in the art in light of the present teachings. In view of the foregoing, this description should not be construed as limiting the invention.

Claims (6)

1. The web page request system based on load balancing is characterized by comprising a client, a load balancing module and a server; the client is connected with the load balancing module and the server respectively, and the load balancing module is connected with the server;
the client is used for sending a web page request message to the load balancing module;
the load balancing module is used for sending the request web page message to the server and determining whether a response web page corresponding to the request web page message is compressed or not;
the server is used for sending a response web page to the load balancing module after receiving the request web page message;
the load balancing module is further used for compressing the response web page and sending the compressed response web page to the web browser of the client when the response web page is determined to be compressed; and when the response web page is determined not to be compressed, sending the response web page to the web browser of the client.
2. The load balancing-based web page request system of claim 1, wherein the load balancing module comprises a compressed web page type list; the compressed web page type list is used for storing web page types preset for compression;
the load balancing module is used for assigning a compression identifier corresponding to the request web page message to be 1 when the web page type corresponding to the request web page message exists in the compression web page type list; and when the web page type corresponding to the request web page message does not exist in the compressed web page type list, assigning the compression identifier corresponding to the request web page message to be 0.
3. The load balancing-based web page request system of claim 1, wherein the load balancing module is configured to compress the response web page using a gzip algorithm.
4. The load balancing-based web page request system of claim 1, wherein the load balancing module is further configured to send the compressed identification to the client;
and the client is used for decompressing the corresponding compressed response web page and displaying the decompressed response web page through a web browser when the received compression identifier is 1.
5. The load balancing-based web page request system of claim 1, wherein the load balancing module is coupled to a plurality of servers.
6. A web page request method based on load balancing, comprising:
the client sends a web page request message to the load balancing module;
the load balancing module sends the request web page message to the server and determines whether a response web page corresponding to the request web page message is compressed or not;
the server sends a response web page to the load balancing module after receiving the request web page message;
the load balancing module compresses the response web page when the response web page is determined to be compressed, and sends the compressed response web page to the web browser of the client; and when the response web page is determined not to be compressed, sending the response web page to the web browser of the client.
CN202310107348.XA 2023-02-10 2023-02-10 Web page request system and method based on load balancing Pending CN116389442A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310107348.XA CN116389442A (en) 2023-02-10 2023-02-10 Web page request system and method based on load balancing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310107348.XA CN116389442A (en) 2023-02-10 2023-02-10 Web page request system and method based on load balancing

Publications (1)

Publication Number Publication Date
CN116389442A true CN116389442A (en) 2023-07-04

Family

ID=86975779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310107348.XA Pending CN116389442A (en) 2023-02-10 2023-02-10 Web page request system and method based on load balancing

Country Status (1)

Country Link
CN (1) CN116389442A (en)

Similar Documents

Publication Publication Date Title
US11032388B2 (en) Methods for prerendering and methods for managing and configuring prerendering operations
US9530099B1 (en) Access to network content
US9055124B1 (en) Enhanced caching of network content
US9497284B2 (en) Apparatus and method for caching of compressed content in a content delivery network
US8914514B1 (en) Managing network based content
US8943223B2 (en) Adaptive session compression management method, compression manager and session management system
Tian et al. Performance considerations for mobile web services
US6438576B1 (en) Method and apparatus of a collaborative proxy system for distributed deployment of object rendering
RU2689439C2 (en) Improved performance of web access
US11019179B2 (en) Access to network content
US10909104B2 (en) Caching of updated network content portions
US20060059246A1 (en) System and method for connection optimization
US20030236862A1 (en) Method and system for determining receipt of a delayed cookie in a client-server architecture
US20030097429A1 (en) Method of forming a website server cluster and structure thereof
US9491113B2 (en) Managing network connections for processing network resources
EP3013015A1 (en) Packet compression method and apparatus
US10049089B2 (en) Methods for compressing web page menus and devices thereof
EP2727024A1 (en) Remote browsing session management
US20040205249A1 (en) Methods and systems for determining whether to compress computer communications
CN116389442A (en) Web page request system and method based on load balancing
US10878187B1 (en) Network-based content rendering
KR100463836B1 (en) Contents conversion and cashing system and method through feature classification of wireless terminals
US9178955B1 (en) Managing network based content
JP2000020415A (en) Www server proxy, www browser proxy and www system
CN113934732A (en) User portrait data processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination