CN106850698A - A kind of User space RPC agreement multithreading optimization methods and system - Google Patents

A kind of User space RPC agreement multithreading optimization methods and system Download PDF

Info

Publication number
CN106850698A
CN106850698A CN201710227820.8A CN201710227820A CN106850698A CN 106850698 A CN106850698 A CN 106850698A CN 201710227820 A CN201710227820 A CN 201710227820A CN 106850698 A CN106850698 A CN 106850698A
Authority
CN
China
Prior art keywords
port
request
service request
service
rpc
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
CN201710227820.8A
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.)
Guangdong Inspur Smart Computing Technology Co Ltd
Original Assignee
Guangdong Inspur Big Data Research 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 Guangdong Inspur Big Data Research Co Ltd filed Critical Guangdong Inspur Big Data Research Co Ltd
Priority to CN201710227820.8A priority Critical patent/CN106850698A/en
Publication of CN106850698A publication Critical patent/CN106850698A/en
Pending legal-status Critical Current

Links

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/133Protocols for remote procedure calls [RPC]

Abstract

The invention discloses a kind of User space RPC agreement multithreading optimization methods and system, the method includes:Monitor whether client sends service request by listening port in RPC service layer;When listening port listens to service request, a request treatment port is called to take over the service request;Parallel processing is carried out to the service request that request treatment port is taken over by default thread pool.In the technical program, add thread pool parallel processing service request, listening port is after the service request for listening to client, service request is put into thread pool by asking treatment port, service request is processed by thread pool scheduling thread, listening port continues to monitor new request, without terminating monitoring, so multiple service requests just can be with parallel processing, improve the concurrency of server-side processes event, the data transmission efficiency of User space RPC is substantially increased, the overall performance of distributed system is then improved.

Description

A kind of User space RPC agreement multithreading optimization methods and system
Technical field
The present invention relates to field of cloud computer technology, more particularly to a kind of User space RPC agreement multithreading optimization methods and System.
Background technology
With the arriving of cloud computing era, people are more and more urgent for the demand of high-performance, the data center of low cost, Used as the most important infrastructure of data center, the demand such as the high-performance of storage system, highly reliable and inexpensive is also increasingly Attract attention.
RPC agreements (far call agreement Remote Procedure Call) are a kind of extensive in distributed memory system The communication protocol of application, it can ask service by network from remote computer program, and can shield bottom-layer network Complexity, can also externally provide close friend interface.RPC uses Client/Server pattern, and requestor is exactly a visitor Family machine, and service providing program is exactly a server.First calling process send a recalls information for having a process parameter to Service processes, then wait response message.In server end, process keeps sleep state untill the arrival of recalls information. When a recalls information is reached, server obtains process parameter, and result of calculation sends answer message, then waits next tune With information, last client call process receives reply message, obtains proceeding results, then calls execution to proceed.RPC roots It is divided into User space RPC and kernel state RPC according to the level difference run, User space program development is simpler than kernel state, extensive It is applied in distributed program exploitation.But User space RPC data transmission efficiencys are low, the globality of distributed system is have impact on Energy.
Therefore, the data transmission efficiency of User space RPC how is improved, is this to improve the overall performance of distributed system The current technical issues that need to address of art personnel.
The content of the invention
It is an object of the invention to provide a kind of User space RPC agreement multithreading optimization methods and system, user can be improved The data transmission efficiency of state RPC, to improve the overall performance of distributed system.
In order to solve the above technical problems, the invention provides following technical scheme:
A kind of User space RPC agreements multithreading optimization method, including:
Monitor whether client sends service request by listening port in RPC service layer;
When the listening port listens to service request, a request treatment port is called to take over the service request;
Parallel processing is carried out to the service request that the request treatment port is taken over by default thread pool.
Preferably, it is described to monitor whether client sends service request by listening port in RPC service layer, including:
Function is created in the server end reconstruct handle of RPC service layer;
Svc_vc_create is called to create the listening port of the service request for monitoring client;
Svc_fd_create requests to create are called to process port;
Monitor whether the client sends service request in real time by the listening port.
Preferably, it is described when the listening port listens to service request, call a request treatment port adapter to be somebody's turn to do Service request, including:
Start service function, whether all of the port for inquiring about the RPC service layer has port to receive information;
If so, whether the port for then judging to receive information is the listening port;
If so, then creating a new request treatment port takes over the service request;
If it is not, it is request treatment port then to judge that this receives the port of information, and according to default treatment request function The service request of port acquisition is decoded, the service request is processed.
A kind of User space RPC agreements multithreading optimizes system, including:
Listening port, for monitoring whether client sends service request in RPC service layer;
Request treatment port, for when the listening port listens to service request, taking over the service request;
Thread pool module, for being connected with extraneous server, the service request to the request treatment port adapter is carried out Parallel processing.
Preferably, also include:
Port creation module, function is created for the server end reconstruct handle in RPC service layer, calls svc_ Vc_create creates the listening port of the service request for monitoring client, calls svc_fd_create requests to create Treatment port.
Preferably, also include:
Enquiry module, for starting service function, whether all of the port for inquiring about the RPC service layer has port to receive Information;
Judge module, for when the enquiry module has inquired port and received information, judgement to receive information Whether port is the listening port;
First performing module, during for judging to receive the port of information in the judge module as the listening port, Create a new request treatment port and take over the service request;
Second performing module, the port for judging to receive information in the judge module is not the listening port When, it is request treatment port to judge that this receives the port of information, and is obtained according to default treatment request letter number decoder port The service request for taking, is processed the service request.
Compared with prior art, above-mentioned technical proposal has advantages below:
A kind of User space RPC agreements multithreading optimization method provided by the present invention, including:In RPC service layer by prison Listen whether port snoop client sends service request;When listening port listens to service request, a request is called to process The service request is taken in port;Parallel processing is carried out to the service request that request treatment port is taken over by default thread pool. In the technical program, add thread pool parallel processing service request, listening port after the service request for listening to client, Service request is put into thread pool by asking treatment port, service request is processed by thread pool scheduling thread, monitor end Mouth continues to monitor new request, and without terminating monitoring, so multiple service requests just can improve server with parallel processing The concurrency for the treatment of event is held, the data transmission efficiency of User space RPC is substantially increased, the entirety of distributed system is then improved Performance.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are the present invention Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis These accompanying drawings obtain other accompanying drawings.
The User space RPC agreement multithreading optimization method flow charts that Fig. 1 is provided by a kind of specific embodiment of the invention.
Specific embodiment
Core of the invention is to provide a kind of User space RPC agreement multithreading optimization methods and system, can improve user The data transmission efficiency of state RPC, to improve the overall performance of distributed system.
In order that the above objects, features and advantages of the present invention can become apparent it is understandable, below in conjunction with the accompanying drawings to this hair Bright specific embodiment is described in detail.
Elaborate detail in order to fully understand the present invention in the following description.But the present invention can with it is various not It is same as other manner described here to implement, those skilled in the art can do class in the case of without prejudice to intension of the present invention Like popularization.Therefore the present invention is not limited by following public specific implementation.
Refer to Fig. 1, the User space RPC agreements multithreading optimization that Fig. 1 is provided by a kind of specific embodiment of the invention Method flow diagram.
A kind of specific embodiment of the invention provides a kind of User space RPC agreements multithreading optimization method, including:
S11:Monitor whether client sends service request by listening port in RPC service layer.
Monitor whether client sends service request by listening port in RPC service layer, including:In RPC service layer Server end reconstruct handle creates function;Svc_vc_create is called to create the monitoring of the service request for monitoring client Port;Svc_fd_create requests to create are called to process port;Monitor whether client sends service in real time by listening port Request.
S12:When listening port listens to service request, a request treatment port is called to take over the service request.
When listening port listens to service request, a request treatment port is called to take over the service request, including:Open Whether dynamic service function, all of the port of inquiry RPC service layer has port to receive information;If so, then judging to receive information Port whether be listening port;If so, then creating a new request treatment port takes over the service request;If it is not, then judging The port for receiving information is request treatment port, and the service obtained according to default treatment request letter number decoder port Request, is processed the service request.
S13:Parallel processing is carried out to the service request that request treatment port is taken over by default thread pool.
In the present embodiment, when listening port listens to the service request of client, the listening-in line of the listening port Cheng Buhui terminate monitor, but by ask treatment port go process the service request, and by this service request be added to please Treatment thread pool is sought, the treatment that corresponding thread completes service request is dispatched by thread pool, listening port continues monitoring and comes from Other service requests of client, are equally put into thread pool after receiving service request, are so repeated, so multiple clothes Business request with parallel processing, can just improve the concurrency of server-side processes event.
Wherein, the technical scheme of present embodiment is mainly carries out multithreading optimization to TI-RPC.Specifically, thread is added Pond carries out parallel processing service request;Reconstitution server end handle creates function, increases port type when port creates and sentences It is disconnected;Reconstruct service run function, after listening to the request from client, service request is put into thread pool by listening port, And listening port continues to monitor new service request.Wherein, reconstruct handle creates function, calls svc_vc_create to create prison Port is listened, calls svc_fd_create requests to create to process port, the listening port of establishment is only responsible for monitoring not going to process asks Information, and ask treatment port to perform the service for the treatment of service request.Start service function svc_run, looked into using poll methods Ask whether all of port receives message, recall macrodefinition function pointer SVC_RECV, when the port that poll chooses When being listening port, a service request for new port adapter listening port can be created, set the SVC_RECV of the new port, A new thread is created in thread pool to go to process this service request, is then back to continue to inquire about whether each port receives newly Information.If the port for inquiring is request treatment port, SVC_RECV is exactly the function for really processing service request, and it can be solved The service request that code is obtained, and service request is processed, request service is completed, result is finally returned into client.
Correspondingly, one embodiment of the present invention additionally provides a kind of User space RPC agreements multithreading optimization system, bag Include:Listening port, for monitoring whether client sends service request in RPC service layer;Request treatment port, for when monitoring When port snoop is to service request, the service request is taken over;Thread pool module, for being connected with extraneous server, at request The service request of reason port adapter carries out parallel processing.
Further, also include:Port creation module, letter is created for the server end reconstruct handle in RPC service layer Number, calls svc_vc_create to create the listening port of the service request for monitoring client, calls svc_fd_create Request to create processes port.
Enquiry module, for starting service function, whether all of the port of inquiry RPC service layer has port to receive letter Breath;Judge module, for when enquiry module has inquired port and has received information, judgement receive information port whether be Listening port;First performing module, during for judging to receive the port of information in judge module as listening port, creates one The service request is taken in new request treatment port;Second performing module, for judging to receive the port of information in judge module When being not listening port, it is request treatment port to judge that this receives the port of information, and according to default treatment request function The service request of port acquisition is decoded, the service request is processed.
In the present embodiment, User space RPC agreements multithreading optimization system is excellent by RPC agreements carrying out multithreading Change, improve the concurrent capability of service processing, while the data exchange efficiency of distributed system can be improved, lifting system is gulped down The amount of telling, so as to improve the overall performance of distributed system.
In sum, User space RPC agreement multithreading optimization methods provided by the present invention and system, can improve user The data transmission efficiency of state RPC, to improve the overall performance of distributed system.
Detailed Jie has been carried out to a kind of User space RPC agreement multithreading optimization methods provided by the present invention and system above Continue.Specific case used herein is set forth to principle of the invention and implementation method, and the explanation of above example is only It is to be used to help understand the method for the present invention and its core concept.It should be pointed out that for those skilled in the art For, under the premise without departing from the principles of the invention, some improvement and modification can also be carried out to the present invention, these improve and repair Decorations are also fallen into the protection domain of the claims in the present invention.

Claims (6)

1. a kind of User space RPC agreements multithreading optimization method, it is characterised in that including:
Monitor whether client sends service request by listening port in RPC service layer;
When the listening port listens to service request, a request treatment port is called to take over the service request;
Parallel processing is carried out to the service request that the request treatment port is taken over by default thread pool.
2. method according to claim 1, it is characterised in that described that client is monitored by listening port in RPC service layer Whether end sends service request, including:
Function is created in the server end reconstruct handle of RPC service layer;
Svc_vc_create is called to create the listening port of the service request for monitoring client;
Svc_fd_create requests to create are called to process port;
Monitor whether the client sends service request in real time by the listening port.
3. method according to claim 2, it is characterised in that described when the listening port listens to service request, A request treatment port is called to take over the service request, including:
Start service function, whether all of the port for inquiring about the RPC service layer has port to receive information;
If so, whether the port for then judging to receive information is the listening port;
If so, then creating a new request treatment port takes over the service request;
If it is not, it is request treatment port then to judge that this receives the port of information, and according to default treatment request letter number decoder The service request that the port obtains, is processed the service request.
4. a kind of User space RPC agreements multithreading optimizes system, it is characterised in that including:
Listening port, for monitoring whether client sends service request in RPC service layer;
Request treatment port, for when the listening port listens to service request, taking over the service request;
Thread pool module, for being connected with extraneous server, the service request to the request treatment port adapter is carried out parallel Treatment.
5. system according to claim 4, it is characterised in that also include:
Port creation module, function is created for the server end reconstruct handle in RPC service layer, calls svc_vc_ Create creates the listening port of the service request for monitoring client, calls at svc_fd_create requests to create Reason port.
6. system according to claim 5, it is characterised in that also include:
Enquiry module, for starting service function, whether all of the port for inquiring about the RPC service layer has port to receive letter Breath;
Judge module, for when the enquiry module has inquired port and received information, judgement to receive the port of information Whether it is the listening port;
First performing module, during for judging to receive the port of information in the judge module as the listening port, creates The service request is taken in one new request treatment port;
Second performing module, when the port for judging to receive information in the judge module is not the listening port, sentences The fixed port for receiving information is request treatment port, and the clothes obtained according to default treatment request letter number decoder port Business request, is processed the service request.
CN201710227820.8A 2017-04-06 2017-04-06 A kind of User space RPC agreement multithreading optimization methods and system Pending CN106850698A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710227820.8A CN106850698A (en) 2017-04-06 2017-04-06 A kind of User space RPC agreement multithreading optimization methods and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710227820.8A CN106850698A (en) 2017-04-06 2017-04-06 A kind of User space RPC agreement multithreading optimization methods and system

Publications (1)

Publication Number Publication Date
CN106850698A true CN106850698A (en) 2017-06-13

Family

ID=59146475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710227820.8A Pending CN106850698A (en) 2017-04-06 2017-04-06 A kind of User space RPC agreement multithreading optimization methods and system

Country Status (1)

Country Link
CN (1) CN106850698A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108762930A (en) * 2018-05-30 2018-11-06 郑州云海信息技术有限公司 A kind of optimization method, system and the associated component of User space NFS threads
CN109814996A (en) * 2019-01-04 2019-05-28 平安科技(深圳)有限公司 Streaming media control method, device and storage medium, computer equipment
CN110008032A (en) * 2018-01-05 2019-07-12 武汉斗鱼网络科技有限公司 A kind of implementation method and electronic equipment of communication mode
CN110012042A (en) * 2018-01-05 2019-07-12 武汉斗鱼网络科技有限公司 A kind of optimization method and electronic equipment of communication mode
CN110008033A (en) * 2018-01-05 2019-07-12 武汉斗鱼网络科技有限公司 The method and electronic equipment that a kind of and client is communicated
CN111355983A (en) * 2018-12-21 2020-06-30 北京字节跳动网络技术有限公司 Service data processing method, device, server and storage medium
CN113360525A (en) * 2021-08-10 2021-09-07 支付宝(杭州)信息技术有限公司 Query request processing method, device and equipment and key value query system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694866A (en) * 2012-06-01 2012-09-26 北京首钢自动化信息技术有限公司 Service request broker system in distributed network environment
CN105516086A (en) * 2015-11-25 2016-04-20 广州华多网络科技有限公司 Service processing method and apparatus
CN106953857A (en) * 2017-03-16 2017-07-14 郑州云海信息技术有限公司 A kind of server end Multithread management method based on CS frameworks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102694866A (en) * 2012-06-01 2012-09-26 北京首钢自动化信息技术有限公司 Service request broker system in distributed network environment
CN105516086A (en) * 2015-11-25 2016-04-20 广州华多网络科技有限公司 Service processing method and apparatus
CN106953857A (en) * 2017-03-16 2017-07-14 郑州云海信息技术有限公司 A kind of server end Multithread management method based on CS frameworks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周俊: "用户态RPC协议分析及其多线程优化", 《计算机研究与发展》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008032A (en) * 2018-01-05 2019-07-12 武汉斗鱼网络科技有限公司 A kind of implementation method and electronic equipment of communication mode
CN110012042A (en) * 2018-01-05 2019-07-12 武汉斗鱼网络科技有限公司 A kind of optimization method and electronic equipment of communication mode
CN110008033A (en) * 2018-01-05 2019-07-12 武汉斗鱼网络科技有限公司 The method and electronic equipment that a kind of and client is communicated
CN110008033B (en) * 2018-01-05 2021-11-09 武汉斗鱼网络科技有限公司 Method for communicating with client and electronic equipment
CN110008032B (en) * 2018-01-05 2021-11-09 武汉斗鱼网络科技有限公司 Communication mode realization method and electronic equipment
CN110012042B (en) * 2018-01-05 2022-01-04 武汉斗鱼网络科技有限公司 Communication mode optimization method and electronic equipment
CN108762930A (en) * 2018-05-30 2018-11-06 郑州云海信息技术有限公司 A kind of optimization method, system and the associated component of User space NFS threads
CN111355983B (en) * 2018-12-21 2022-03-18 北京字节跳动网络技术有限公司 Service data processing method, device, server and storage medium
CN111355983A (en) * 2018-12-21 2020-06-30 北京字节跳动网络技术有限公司 Service data processing method, device, server and storage medium
CN109814996A (en) * 2019-01-04 2019-05-28 平安科技(深圳)有限公司 Streaming media control method, device and storage medium, computer equipment
CN109814996B (en) * 2019-01-04 2024-03-22 平安科技(深圳)有限公司 Streaming media transmission control method and device, storage medium and computer equipment
CN113360525A (en) * 2021-08-10 2021-09-07 支付宝(杭州)信息技术有限公司 Query request processing method, device and equipment and key value query system
CN113360525B (en) * 2021-08-10 2021-12-07 支付宝(杭州)信息技术有限公司 Query request processing method, device and equipment and key value query system

Similar Documents

Publication Publication Date Title
CN106850698A (en) A kind of User space RPC agreement multithreading optimization methods and system
CN111580995B (en) Synchronous communication method and system of distributed cloud platform and Internet of things intelligent terminal based on MQTT asynchronous communication scene
CN101175114B (en) Automatic reminding method, method for returning remind information, corresponding equipment and system
CN104932941B (en) A kind of distributed message processing system and device and method therein
CN106412009A (en) Interface calling method and device
CN103139157A (en) Network communication method based on socket, device and system
CN104408110B (en) The method, apparatus and system of request of data
US8775507B2 (en) Rest interface for job submission
CN109327511A (en) A kind of data request method and server based on http protocol
CN105681426B (en) Heterogeneous system
CN107454177A (en) The dynamic realizing method of network service
CN106993286A (en) Radio reception device accesses high in the clouds AC method and system in a kind of wireless network
CN110062004A (en) A kind of message handling system and method based on Internet of Things fidonetFido
CN110377407A (en) A kind of scan task dispatching method, device, storage medium and equipment
CN112104679B (en) Method, apparatus, device and medium for processing hypertext transfer protocol request
CN108829740A (en) Date storage method and device
CN102902593B (en) Agreement distributing and processing system based on caching mechanism
CN111724262B (en) Subsequent package query system of application server and working method thereof
CN112448977A (en) System, method, apparatus and computer readable medium for assigning tasks
CN104394198B (en) A kind of overall scheduling method based on ESB
CN110149371A (en) Equipment connection method, device and terminal device
CN109495303A (en) Obtain the method, device network managing device and system, electronic device and storage medium of equipment parameter information
CN111813529B (en) Data processing method, device, electronic equipment and storage medium
CN108063819A (en) Data communications method and device
CN114579311A (en) Method, apparatus, device and storage medium for executing distributed computing task

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: 20170613

RJ01 Rejection of invention patent application after publication