Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method and device for dynamically allocating server threads

A dynamic allocation and server-side technology, applied in the Internet field, can solve the problems that the interface response time cannot be allocated to the server-side thread, the server-side thread cannot be released in time, and the RPC request message cannot be processed in time.

Active Publication Date: 2020-01-31
ADVANCED NEW TECH CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In the above method, if the response time of the interface corresponding to interface 1 is very long, and the response time of the interface corresponding to interface 2 is very short, and there are a large number of RPC request messages corresponding to interface 1, a large number of server threads will be used to process interface 1 The corresponding RPC request message, the server thread cannot be released in time, and then the RPC request message corresponding to interface 2 cannot be processed in time, that is, interface 2, which has a short interface response time, cannot be allocated to more server threads. The utilization rate of its server thread is very low

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and device for dynamically allocating server threads
  • A method and device for dynamically allocating server threads
  • A method and device for dynamically allocating server threads

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] Aiming at the problems existing in the prior art, Embodiment 1 of the present application provides a method for dynamically allocating server threads. The method is applied to a system including a server and multiple clients, and the system may be a distributed system. Such as figure 1 As shown, the dynamic allocation method of the server thread includes the following steps:

[0050] Step 101, the server uses the interface information corresponding to each interface to allocate the number of first server threads of each interface. Wherein, the interface information corresponding to each interface specifically includes, but is not limited to: the average interface response time corresponding to each interface within a specified time period (such as from the 100th millisecond before the current time to the current time), and / or, the response time of each interface at the specified time The number of received RPC request messages corresponding to the segment.

[0051] Us...

Embodiment 2

[0081] Based on the same application concept as the above method, a server is also provided in the embodiment of the present application, such as figure 2 As shown, the server specifically includes: an allocation module 11, configured to allocate the number of first server threads corresponding to each interface by using the interface information corresponding to each interface; a determination module 12, configured to receive a remote procedure call RPC request After the message, determine the number of second server threads that the interface corresponding to the RPC request message has currently started; processing module 13, for when the number of second server threads is less than the number of first server threads corresponding to the interface , then start the server thread for the RPC request message; when the number of the second server thread is equal to the number of the first server thread corresponding to the interface, then refuse to start the server thread for t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The application discloses a dynamic distribution method and device for server threads. The method comprises: allocating first server thread quantity of each interface by a server through utilizing interface information corresponding to each interface; after receiving an RPC request message, determining currently started second server thread quantity of an interface corresponding to the RPC request message; if the second server thread quantity is less than the first server thread quantity corresponding to the interface, starting a server thread for the RPC request message by the server; and if the second server thread quantity is equal to the first server thread quantity corresponding to the interface, refusing to start the server thread for the RPC request message by the server. According to embodiments of the invention, the server can reasonably allocate the server thread for each interface, so that the utilization rate of the server threads is increased as far as possible, and the optimal allocation of the server threads and the maximization of server performance are realized.

Description

technical field [0001] This application relates to the Internet field, in particular to a method and device for dynamically allocating server threads. Background technique [0002] The RPC (Remote Procedure Call, remote procedure call) protocol is a communication protocol between processes, and the client can request the service provided by the server through the RPC protocol. [0003] Specifically, after the server publishes a service, the client sends an RPC request message to the server according to the calling parameters. After receiving the RPC request message, the server starts a server thread for the RPC request message, and uses the server thread to serve the client To provide services, that is, the server thread uses the call parameters carried in the RPC request message to provide services for the client, and returns the service result to the client through the RPC response message. After receiving the RPC response message, the client can call the corresponding se...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/50G06F9/54G06F9/46
Inventor 湛滨瑜
Owner ADVANCED NEW TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products