Request processing optimization method and computer readable storage medium
An optimization method and request processing technology, applied in the Internet field, can solve the problems of microservice request congestion, time-consuming, request failure, etc., and achieve the effect of reducing the probability of task execution failure, improving the execution success rate, and improving the request success rate.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035] Please refer to figure 2 , Embodiment 1 of the present invention is: an optimization method for request processing, which can be applied to a microservice architecture, and includes the following steps:
[0036] S1: Create a first-in first-out queue and a first-in last-out queue; that is, in the system content of the server, create two queues, namely the first-in first-out queue and the first-in last-out queue. The length of the queue can be set according to conditions such as memory size, preferably, the length of the queue is 1024.
[0037] S2: According to the preset cycle, detect the CPU usage rate of the device where the server is located, or obtain the total number of task messages processed within the cycle, and calculate the message processing speed. That is, the CPU resource occupancy is detected in each cycle to obtain the CPU occupancy rate of the current cycle; or at the end of the current cycle, the total number of task messages processed by the server in...
Embodiment 2
[0052] This embodiment is a computer-readable storage medium corresponding to the above-mentioned embodiments, on which a computer program is stored, and when the program is executed by a processor, the following steps are implemented:
[0053] Create first-in-first-out queues and first-in-last-out queues;
[0054] When the server has a request timeout or reaches the upper limit of the number of task processing, obtain the CPU usage or message processing speed of the device where the server is located;
[0055] If the CPU occupancy rate does not reach a preset first threshold or the message processing speed reaches a preset second threshold, write the received task message into the first-in-first-out queue;
[0056] If the CPU usage rate reaches a preset first threshold or the message processing speed does not reach a preset second threshold, write the received task message into the first-in-last-out queue.
[0057] Further, before acquiring the CPU usage rate or message proc...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com