CN107977267A - For improving the method and apparatus of one process network program performance - Google Patents
For improving the method and apparatus of one process network program performance Download PDFInfo
- Publication number
- CN107977267A CN107977267A CN201610941438.9A CN201610941438A CN107977267A CN 107977267 A CN107977267 A CN 107977267A CN 201610941438 A CN201610941438 A CN 201610941438A CN 107977267 A CN107977267 A CN 107977267A
- Authority
- CN
- China
- Prior art keywords
- process network
- network program
- program
- designated port
- mentioned steps
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5012—Processor sets
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the present invention provides a kind of method and apparatus for being used to improve one process network program performance, belongs to field of computer technology.Method includes:Step a), enables the one process network program, and by the programmatic binding to designated port, to monitor the designated port;And step b), above-mentioned steps a) is performed a plurality of times, so that the one process network program is repeatedly started and monitors the same designated port.The present invention uses multiplexed port mechanism, without existing network server source code, any modification is made also without to existing application program, the binding of multi-process network server can be achieved and monitor same port, one process network server is set easily to be converted into multi-process program, so as to the performance boost for making full use of multi-core processor to bring, do not increase maintenance and use cost at the same time, to needing the network server that this respect is transformed to have the effect and meaning of highly significant.
Description
Technical field
The present invention relates to field of computer technology, and in particular, to a kind of to be used to improve one process network program performance
Method and apparatus.
Background technology
With the rapid development of hardware technology, present central processing unit is the framework of multi-core already, physically
It is primary support multi-process, multithreads computing, substantially can be double come improve program feature performance.Also have at present
The service routine in stable operation many years does not carry out program optimization for polycaryon processor, and the sharp new hardware strap that has more than is needed comes very
Convenient performance boost.
Chinese patent application CN201410825974.3 describes a kind of meeting of the multi-process server program on linux system
Keeping method is talked about, this method needs each Network Server Processes to set RESUEPORT options to the socket of monitoring;It is Chinese special
Profit application CN201410510222.8 describes a kind of method for lifting application delivery communication platform multi-process program feature, this method
Process data is bound to network interface card queue and CPU core, improves the cache hit rate of CPU, and then improve performance.Above-mentioned two patent Shens
Although REUSEPORT multiplexed ports and multi-process program please be directed to, they are all by changing existing network
For server process code come what is realized, this requires the source code of the network server, and needs weight after modification
Newly compiled is disposed.
However, since the time is remote, the source code of many programs may have no way of searching, and directly change program's source code to carry
High performance method also has no way of implementing.Above-mentioned limitation causes to greatly improve network program service performance on single server very tired
Difficulty, can only be by increasing multiple servers, the method separately disposed.This adds increased purchase cost, administrator safeguard also than with
It is preceding more difficult, and the hardware performance of each server also has quite a few to be in idle state, causes apparent money
Source wastes.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of method and apparatus for being used to improve one process network program performance, its
Using multiplexed port mechanism, without existing network server source code, it is not required that existing application program is done any
Modification, you can realize that same port is monitored in the binding of multi-process network server, be very easy to one process network server
Ground is converted into multi-process program, so as to the performance boost for making full use of multi-core processor to bring, while does not increase
Maintenance and use cost, to needing the network server that this respect is transformed to have the effect and meaning of highly significant.
To achieve these goals, the embodiment of the present invention provides a kind of side for being used to improve one process network program performance
Method, this method include:Step a), enables the one process network program, and by the programmatic binding to designated port, with monitor should
Designated port;And step b), above-mentioned steps a) is performed a plurality of times, so that the one process network program is repeatedly started and supervised
Listen the same designated port.
Optionally, the step a) further includes the different core that the one process network program of startup is tied to processor.
Optionally, the above-mentioned steps that are performed a plurality of times include the core for performing number and being equal to processor so that above-mentioned steps
Quantity.
Optionally, before the one process network program is enabled, this method further includes:Change LINUX core network moulds
Block setsockopt () interface, makes its acquiescence use RESUEPORT parameters.
Correspondingly, the embodiment of the present invention also provides a kind of equipment for being used to improve one process network program performance, the equipment
Including:For performing the device of step a), step a) includes enabling the one process network program, and the programmatic binding is arrived
Designated port, to monitor the designated port;And for performing the device of step b), step b) includes above-mentioned step is performed a plurality of times
It is rapid a) so that the one process network program is repeatedly started and monitors the same designated port.
Optionally, the step a) further includes the different core that the one process network program of startup is tied to processor.
Optionally, the above-mentioned steps that are performed a plurality of times include the core for performing number and being equal to processor so that above-mentioned steps
Quantity.
Optionally, which further includes for performing the device operated below:Enable the one process network program it
Before, LINUX core network module setsockopt () interface is changed, its acquiescence is used RESUEPORT parameters.
Through the above technical solutions, it is not necessary to modify existing network server, you can completion is converted into more by one process
Process.The multi-process multiport program that in addition, there will be also can rapid translating into multi-process single port program.In multi-process pattern
Under, client session can be kept to connect, and under multi-core central processing unit platform, program feature can be significantly improved.
The further feature and advantage of the embodiment of the present invention will be described in detail in subsequent specific embodiment part.
Brief description of the drawings
Attached drawing is that the embodiment of the present invention is further understood for providing, and a part for constitution instruction, with
The embodiment in face is used to explain the embodiment of the present invention together, but does not form the limitation to the embodiment of the present invention.Attached
In figure:
Fig. 1 is the flow chart for being used to improve the method for one process network program performance that one embodiment of the invention provides;
Fig. 2 is the flow chart for being used to improve the method for one process network program performance that another embodiment of the present invention provides;
And
Fig. 3 is the structure diagram of multi-process parallel processing service request.
Embodiment
The embodiment of the embodiment of the present invention is described in detail below in conjunction with attached drawing.It should be appreciated that this
Locate described embodiment and be merely to illustrate and explain the present invention embodiment, be not intended to limit the invention embodiment.
Fig. 1 is the flow chart for being used to improve the method for one process network program performance that one embodiment of the invention provides.Such as
Shown in Fig. 1, the embodiment of the present invention provides a kind of method for being used to improve one process network program performance, and this method includes:Step
A), the one process network program is enabled, and by the programmatic binding to designated port, to monitor the designated port;And step
B), above-mentioned steps a) is performed a plurality of times, so that the one process network program is repeatedly started and monitors the same designated ends
Mouthful.With this solution, it can be achieved that multiplexed port, it is allowed to which multiple web applications on a machine are same while listening for binding
The same end slogan of IP address, that is to say, that multiple processes can use same port numbers at the same time, and can keep data
The flow direction of bag, the session connection initiated by same client transfer to same service processes to handle all the time, and there is no once can
Data in words connection are assigned to the situation of different service processes.
It should be noted that for above-mentioned steps a), wherein involved one process network program remains existing
One process network program, the present invention without making any change to it, the Starting mode of the one process network program also with it is existing
Starting mode it is identical.Can there are N number of network by starting repeatedly (for example, n times) to one process network program, in final system
Service processes, thus can realize or else change on the premise of existing network server by one process network program be converted into it is more into
The purpose of journey network program.
Fig. 2 is the flow chart for being used to improve the method for one process network program performance that another embodiment of the present invention provides.
As shown in Figure 2, it is preferable that while starting one process network program and binding it to designated port, can also be bound
To the different core of processor, so as to which process is tied in each core of fixed multi-core processor.By operation
Process is tied to fixed processor core, and unnecessary context can be avoided to switch, there is provided cpu cache hit rate, further
Improving performance.
Preferably, the number of starts of the one process network program can be equal to the quantity of the core of processor, so as to protect
Each process of card network program corresponds to a core, it is ensured that processor core maximally utilizes, and improves one process network journey
The execution efficiency of sequence.
Optionally, before the one process network program is enabled, this method further includes:Change LINUX core network moulds
Block setsockopt () interface, makes its acquiescence use RESUEPORT parameters.New version LINUX kernels (version >=
2.3.9 RESUEPORT characteristics) have been supported, and client session can have been kept to connect, but have needed upper layer network program to lead to
Cross setsockopt () interface and RESUEPORT parameters are explicitly set.In this step, connect by changing setsockopt ()
Mouth realizes code, interface acquiescence is used RESUEPORT parameters;After modification, upper layer network program without any modification,
The facility that RESUEPORT characteristics are brought can be enjoyed.
By the scheme shown in Fig. 2, it can be achieved that multi-process parallel processing, each core of multi-core processor can handle journey
Sequence business, and a same session connection for same client can be assigned on same treatment progress, and there is no same
Data flow is successively assigned to the situation in different processes.
Fig. 3 is the structure diagram of multi-process parallel processing service request.As shown in figure 3, by repeatedly starting one process
Network program, will cause in system while operation has multiple processes (process 1, process 2 in such as Fig. 3 ..., process N), realize single
The conversion of process network program at most process network program.Each process monitors same port, and via the same port with
Each client outside server keeps connection, so that N number of process can provide network service jointly, parallel processing comes from client
The request at end, and client session can be kept to connect.
Correspondingly, the embodiment of the present invention also provides a kind of equipment for being used to improve one process network program performance, the equipment
Including:For performing the device of step a), step a) includes enabling the one process network program, and the programmatic binding is arrived
Designated port, to monitor the designated port;And for performing the device of step b), step b) includes above-mentioned step is performed a plurality of times
It is rapid a) so that the one process network program is repeatedly started and monitors the same designated port.
Optionally, the step a) further includes the different core that the one process network program of startup is tied to processor.
Optionally, the above-mentioned steps that are performed a plurality of times include the core for performing number and being equal to processor so that above-mentioned steps
Quantity.
Optionally, which further includes for performing the device operated below:Enable the one process network program it
Before, LINUX core network module setsockopt () interface is changed, its acquiescence is used RESUEPORT parameters.
In relation to detail and benefit that this is used to improve the equipment of one process network program performance, above-mentioned be directed to see
Description for the method for improving one process network program performance, repeats no more in this.
The optional embodiment of example of the present invention, still, the embodiment of the present invention and unlimited are described in detail above in association with attached drawing
Detail in the above embodiment, can be to the embodiment of the present invention in the range of the technology design of the embodiment of the present invention
Technical solution carry out a variety of simple variants, these simple variants belong to the protection domain of the embodiment of the present invention.
It is further to note that each particular technique feature described in above-mentioned embodiment, in not lance
In the case of shield, it can be combined by any suitable means.In order to avoid unnecessary repetition, the embodiment of the present invention pair
Various combinations of possible ways no longer separately illustrate.
It will be appreciated by those skilled in the art that realize that all or part of step in above-described embodiment method is to pass through
Program instructs relevant hardware to complete, and the program storage is in a storage medium, including some instructions are used so that one
A (can be microcontroller, chip etc.) or processor (processor) perform the whole of each embodiment the method for the application
Or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
In addition, it can also be combined between a variety of embodiments of the embodiment of the present invention, as long as it is not
The thought of the embodiment of the present invention is run counter to, it should equally be considered as disclosure of that of the embodiment of the present invention.
Claims (8)
1. a kind of method for being used to improve one process network program performance, this method include:
Step a), enables the one process network program, and by the programmatic binding to designated port, to monitor the designated port;
And
Step b), is performed a plurality of times above-mentioned steps a), so that the one process network program is repeatedly started and monitors same institute
State designated port.
2. according to the method described in claim 1, it is characterized in that, the step a) is further included the one process network journey of startup
Sequence is tied to the different core of processor.
3. according to the method described in claim 2, it is characterized in that, the above-mentioned steps that are performed a plurality of times are included so that above-mentioned steps
Perform number be equal to processor core quantity.
4. according to the method described in any one of claim 1-3 claim, it is characterised in that enabling the one process net
Before network program, this method further includes:
LINUX core network module setsockopt () interface is changed, its acquiescence is used RESUEPORT parameters.
5. a kind of equipment for being used to improve one process network program performance, the equipment include:
For performing the device of step a), step a) includes enabling the one process network program, and the programmatic binding is arrived
Designated port, to monitor the designated port;And
For performing the device of step b), step b) includes above-mentioned steps a) is performed a plurality of times, so that the one process network
Program is repeatedly started and monitors the same designated port.
6. equipment according to claim 1, it is characterised in that the step a) is further included the one process network journey of startup
Sequence is tied to the different core of processor.
7. equipment according to claim 6, it is characterised in that the above-mentioned steps that are performed a plurality of times are included so that above-mentioned steps
Perform number be equal to processor core quantity.
8. according to the equipment described in any one of claim 5-7 claim, it is characterised in that the equipment is further included for holding
The device of the following operation of row:Before the one process network program is enabled, LINUX core network modules setsockopt is changed
() interface, makes its acquiescence use RESUEPORT parameters.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610941438.9A CN107977267A (en) | 2016-10-25 | 2016-10-25 | For improving the method and apparatus of one process network program performance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610941438.9A CN107977267A (en) | 2016-10-25 | 2016-10-25 | For improving the method and apparatus of one process network program performance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107977267A true CN107977267A (en) | 2018-05-01 |
Family
ID=62005094
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610941438.9A Pending CN107977267A (en) | 2016-10-25 | 2016-10-25 | For improving the method and apparatus of one process network program performance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107977267A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760374A (en) * | 2021-08-30 | 2021-12-07 | 海信电子科技(深圳)有限公司 | Processor binding method and device and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101296130A (en) * | 2008-05-30 | 2008-10-29 | 北京同步科技有限公司 | System and method for multi-process sharing port receiving network message |
CN104281493A (en) * | 2014-09-28 | 2015-01-14 | 般固(北京)科技股份有限公司 | Method for improving performance of multiprocess programs of application delivery communication platforms |
CN104503853A (en) * | 2014-12-25 | 2015-04-08 | 般固(北京)科技股份有限公司 | Session holding method of multi-process server program on Linux system |
US20150143354A1 (en) * | 2013-11-19 | 2015-05-21 | Suresh Mathew | Zero downtime deployment and rollback |
CN105930191A (en) * | 2016-04-28 | 2016-09-07 | 网宿科技股份有限公司 | System service reloading method and apparatus |
-
2016
- 2016-10-25 CN CN201610941438.9A patent/CN107977267A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101296130A (en) * | 2008-05-30 | 2008-10-29 | 北京同步科技有限公司 | System and method for multi-process sharing port receiving network message |
US20150143354A1 (en) * | 2013-11-19 | 2015-05-21 | Suresh Mathew | Zero downtime deployment and rollback |
CN104281493A (en) * | 2014-09-28 | 2015-01-14 | 般固(北京)科技股份有限公司 | Method for improving performance of multiprocess programs of application delivery communication platforms |
CN104503853A (en) * | 2014-12-25 | 2015-04-08 | 般固(北京)科技股份有限公司 | Session holding method of multi-process server program on Linux system |
CN105930191A (en) * | 2016-04-28 | 2016-09-07 | 网宿科技股份有限公司 | System service reloading method and apparatus |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760374A (en) * | 2021-08-30 | 2021-12-07 | 海信电子科技(深圳)有限公司 | Processor binding method and device and electronic equipment |
CN113760374B (en) * | 2021-08-30 | 2023-04-21 | 海信电子科技(深圳)有限公司 | Binding method and device of processor and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Luo et al. | Parameter hub: a rack-scale parameter server for distributed deep neural network training | |
CN103501344B (en) | The method and system of single-sign-on are realized in many applications | |
US20110161495A1 (en) | Accelerating opencl applications by utilizing a virtual opencl device as interface to compute clouds | |
US20140149978A1 (en) | Dynamic communication between script and execution layers | |
US8694777B2 (en) | Securely identifying host systems | |
CN103281359A (en) | Cloud desktop system and operating method | |
JP2005332396A (en) | System and method for pci express advanced switching of information processing system | |
CN108228349A (en) | For handling the method for task, system and storage medium | |
Georgiou et al. | Evaluating scalability and efficiency of the resource and job management system on large HPC clusters | |
CN107528708A (en) | A kind of method and system for arranging Linux server cluster | |
CN115529786A (en) | Hybrid cooling system for data center | |
Chang et al. | Access security on cloud computing implemented in hadoop system | |
CN203301532U (en) | Cloud desktop system | |
CN107977267A (en) | For improving the method and apparatus of one process network program performance | |
CN105327508A (en) | Network game running system and method | |
CN103873443B (en) | Information processing method, local proxy server and network proxy server | |
CN105677481B (en) | A kind of data processing method, system and electronic equipment | |
KR20130085713A (en) | A server, an arithmatic processing method and a system thereof | |
CN107493574B (en) | Wireless controller equipment, parallel authentication processing method, system and networking device | |
US20220046647A1 (en) | Logical channel management in a communication system | |
Hu et al. | A dynamic User-Integrated cloud computing architecture | |
JP2017535089A (en) | Interactive voice response system crawler | |
DE102022120593A1 (en) | LOAD MONITORING OF A DATA CENTER | |
CN104598297B (en) | virtual machine management method and device | |
CN116209868A (en) | In-line cooling unit with interchangeable heat exchanger |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180501 |
|
RJ01 | Rejection of invention patent application after publication |