CN115396486A - Connection pool processing method and device, storage medium and equipment - Google Patents

Connection pool processing method and device, storage medium and equipment Download PDF

Info

Publication number
CN115396486A
CN115396486A CN202211050306.9A CN202211050306A CN115396486A CN 115396486 A CN115396486 A CN 115396486A CN 202211050306 A CN202211050306 A CN 202211050306A CN 115396486 A CN115396486 A CN 115396486A
Authority
CN
China
Prior art keywords
connections
connection pool
idle
current
connection
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
CN202211050306.9A
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.)
Chongqing Ant Consumer Finance Co ltd
Original Assignee
Chongqing Ant Consumer Finance 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 Chongqing Ant Consumer Finance Co ltd filed Critical Chongqing Ant Consumer Finance Co ltd
Priority to CN202211050306.9A priority Critical patent/CN115396486A/en
Publication of CN115396486A publication Critical patent/CN115396486A/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/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • 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/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session

Abstract

The specification discloses a connection pool processing method, a connection pool processing device, a storage medium and equipment, wherein the method comprises the following steps: determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool; determining the number of current required renewal connections corresponding to the current host connection pool according to the number of idle connections and the number of waiting threads; and carrying out the continuation processing on the idle connection of the current host connection pool according to the number of the idle connections and the number of the current required continuation connections.

Description

Connection pool processing method and device, storage medium and equipment
Technical Field
The present disclosure relates to the field of big data technologies, and in particular, to a connection pool processing method, apparatus, storage medium, and device.
Background
In a distributed high concurrency scenario, connections between a client to a server and among multiple nodes on the server are often managed using a connection pool.
In a technical scheme, idle connections created in advance are stored in a connection pool, and when an HTTP (Hyper Text Transfer Protocol) request comes, the idle connections in the connection pool are used for accessing a server side, so that the expenses of creating and destroying connections are saved. However, for service characteristics such as a flexible TPS (Transaction Per Second) scenario, for example, a scenario where TPS exhibits peaks and troughs, the technical solution cannot ensure stability of response time.
Therefore, how to ensure the stability of the response time under the elastic TPS scene becomes a technical problem to be solved urgently.
Disclosure of Invention
The present specification provides a connection pool processing method, device, storage medium, and apparatus, which can ensure stability of response time in an elastic TPS scenario.
In a first aspect, an embodiment of the present specification provides a connection pool processing method, including:
determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool;
determining the number of current required renewal connections corresponding to the current host connection pool according to the number of the idle connections and the number of the waiting threads;
and carrying out the renewal treatment on the idle connection of the current host connection pool according to the number of the idle connections and the number of the current renewal connections.
In a second aspect, an embodiment of the present specification provides a connection pool processing apparatus, including:
the traffic determining module is used for determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool;
a number of continuation connections determining module, configured to determine, according to the number of idle connections and the number of waiting threads, a number of current required continuation connections corresponding to the current host connection pool;
and the continuation processing module is used for continuing the idle connections of the current host connection pool according to the number of the idle connections and the number of the current connections needing to be continued.
In a third aspect, embodiments of the present specification provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the steps of the above-described method.
In a fourth aspect, embodiments of the present specification provide a computer program product comprising instructions which, when run on a computer or processor, cause the computer or processor to perform the steps of the method described above.
In a fifth aspect, an embodiment of the present specification provides an electronic device, including: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the above-described method.
According to the technical scheme of the embodiment of the description, on one hand, the number of the current required renewal connections corresponding to the current host connection pool is determined by determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool, and the number of the current required renewal connections corresponding to the current host connection pool can be dynamically determined in an elastic TPS scene; on the other hand, the idle connections of the current host connection pool are subjected to the reservation processing according to the number of the idle connections and the number of the current connections which need to be reserved, the number of the idle connections of the host connection pool can be efficiently adjusted based on the current TPS condition, and therefore the stability of response time can be ensured under the flexible TPS scene; on the other hand, as the current host connection pool can be ensured to have a certain long connection persistence, the time for establishing the connection between the client and the server can be reduced for a low TPS scene.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram of a system architecture for connecting a pool processing device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a connection pool processing method provided in an embodiment of the present specification;
FIG. 3 is a flow chart illustrating a process for dynamically determining a number of currently required continuation connections according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart of another connection pool processing method provided in the embodiments of the present disclosure;
FIG. 5 is a schematic diagram of modules of a connection pool processing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a connection pool processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
In order to make the features and advantages of the present specification more apparent and understandable, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only a part of the embodiments of the present specification, and not all the embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in this specification fall within the scope of protection of this specification.
First, the noun terms referred to in one or more embodiments of the present specification are explained.
TPS: number of transactions processed per second. A transaction refers to the process of a client sending a request to a server and the server responding. The client starts timing when sending the request, and finishes timing after receiving the response of the server, so as to calculate the used time and the number of completed transactions, and further calculate the number of transactions processed per second.
Elastic TPS scenario: refers to the situation that TPS exhibits peaks and valleys, for example, after product iteration, TPS exhibits a valley state in the white list verification stage; under the review scene, the TPS presents obvious wave peak and wave trough conditions and the like.
Connection (Connection): the method is used for communication connection between the client and the server.
Long Connection (Long Connection): after the client end completes the request, the connection is not closed actively, and the multiplexing connection is continued.
Short Connection (Short Connection): the method is used for closing the connection after the request of the client is completed.
Connection Pool (Connection Pool): for hosting a centralized pool of Connection connections.
Bidirectional queue: the data structure allowing the insertion of delete elements at the head and tail of the queue.
RT (Response Time, response duration): the time consumed by the client to request the server.
Free Connection (Free Connection): refers to an available connection with the connection in an idle state.
Next (Renew): meaning that after the connection has expired, the client and server remain connected, e.g., keep a heartbeat connection.
Number of currently required continuity connections (minActiveConnections): the minimum number of idle connections in the connection pool that are required to maintain a heartbeat connection with the peer server.
In one technical scheme, a connection pool management scheme based on long connection is provided in the face of a high TPS scene, but the connection pool management scheme cannot dynamically adapt to a low TPS scene, repeated link establishment and handshake are caused, extra performance loss is caused, and RT time consumption is increased; in the low TPS scene, a connection pool management scheme based on short connection is provided, but the connection pool management scheme does not have the problem of time consumption for changing RT, and the performance of a connection pool is difficult to meet once TPS becomes high.
Based on the above, embodiments of the present specification provide a connection pool processing method and a connection pool processing apparatus, on one hand, by determining the number of idle connections and the number of waiting threads corresponding to a current host connection pool, determining the number of current required renewal connections corresponding to the current host connection pool, and dynamically determining the number of current required renewal connections corresponding to the current host connection pool in an elastic TPS scene; on the other hand, according to the number of idle connections and the number of connections which need to be continued currently, the number of idle connections of the host connection pool can be efficiently adjusted based on the current TPS condition, so that the stability of response time length can be ensured in an elastic TPS scene; on the other hand, as the current host connection pool can be ensured to have a certain long connection persistence, the time for establishing the connection between the client and the server can be reduced for a low TPS scene.
Hereinafter, the technical solutions of the embodiments of the present specification will be described in detail with reference to the accompanying drawings.
Fig. 1 is a system architecture diagram of a connection pool processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 1, the system architecture includes a global connection pool 110 and a connection pool handling means 120. The global connection pool 110 includes a plurality of host connection pools, and each host connection pool stores at least one connection;
the connection pool handling means 120 comprises a processor 112, the connection pool handling means 120 maintaining a connection pool for each HTTP route. The connection pool manager 120 detects the state information of at least one connection in the connection pool 110, and processes the detection result according to a preset connection configuration rule to obtain a connection configuration policy for the global connection pool 110; and configuring the global connection pool 110 according to a connection configuration policy, so that at least one available idle connection is configured in the global connection pool, and further, when the connection pool receives a connection acquisition request, allocating the available idle connection to a requester of the connection acquisition request.
The global connection pool 110 creates a connection with the server side in advance. In this way, the global connection pool 110 may allocate a free connection to a client when a connection acquisition request for the client is received.
It should be noted that the connection pool processing apparatus in fig. 1 may be deployed on a server side, and perform connection pool processing through the server. The server may be a physical server comprising independent hosts, or a virtual server carried by a cluster of hosts, or a cloud server.
Based on the system architecture shown in fig. 1, the connection pool processing method provided in the embodiment of the present disclosure will be described in detail below with reference to fig. 2 to 4.
Referring to fig. 2, a flowchart of a connection pool processing method, which may be executed by a server, is provided for the embodiment of the present specification. As shown in fig. 2, the method of the embodiments of the present specification may include the following steps S210 to S230.
In step S210, the number of idle connections and the number of waiting threads corresponding to the current host connection pool are determined.
In an example embodiment, the current host connection pool may be a single connection pool or one of a plurality of connection pools. A plurality of idle connections are set in the current host connection pool, and the idle connections are used for communication connection between the client and the server, for example, a host server for www.xxx.com:80 is set, and the current host connection pool is set with 80 idle connections.
For example, when a new HTTP request to the Host comes, if the current Host connection pool has no available idle connection, the thread processing the HTTP request waits to form a waiting thread, and when the current Host connection pool has available idle connection, the available idle connection is obtained from the current Host connection pool.
Further, the current host connection pool may use a linked list to manage idle connections and wait thread queues for waiting for connections, and obtain the number of idle connections and the number of wait threads corresponding to the current host connection pool from the linked list.
It should be noted that other data structures, such as a queue or a bidirectional queue, may also be used to manage the idle connections and the waiting threads corresponding to the current host connection pool, and obtain the number of idle connections and the number of waiting threads corresponding to the current host connection pool from the queue or the bidirectional queue.
In step S220, the number of currently required renewal connections corresponding to the current host connection pool is determined according to the number of idle connections and the number of waiting threads.
In an example embodiment, renew (Renew) refers to the client and server maintaining a connection, e.g., maintaining a heartbeat connection, after the connection has expired. The number of current renewal connections refers to the number of least active or least idle connections, minactiveconnections, in the connection pool that need to maintain a heartbeat connection with the peer server. Further, the number of currently required renewal connections corresponding to the current host connection pool may be dynamically determined according to the number of idle connections corresponding to the current host connection pool and the number of waiting threads.
For example, if the number of currently waiting threads is greater than a predetermined threshold, e.g., greater than zero, then it is determined that the number of currently required persistent connections of the current host connection pool is equal to the number of idle connections of the current host connection pool; if the number of the current waiting threads is equal to zero and the number of the idle connections is equal to zero, determining that the number of the current continuous connections required by the current host connection pool is kept unchanged; and if the number of the waiting threads is equal to zero and the number of the idle connections is greater than zero, carrying out capacity reduction processing on the number of the current continuous connections of the current host connection pool according to a preset capacity reduction factor.
For example, if the number of idle connections in the current host connection pool is 10, and the number of waiting threads is greater than zero; determining that the number of currently required continuous connections in the current host connection pool is equal to the number of idle connections, namely 10, that is, the number of the minimum idle connections required to maintain heartbeat connection with the opposite-end server in the current host connection pool is 10; if the number of waiting threads is equal to zero and the number of idle connections is 10, then the current number of persistent connections of the current host connection pool is scaled by a predetermined scaling factor, for example, 0.5.
In step S230, the idle connections in the current host connection pool are subject to the persistent processing according to the number of idle connections and the number of connections that need to be persistent currently.
In an example embodiment, if there are expired idle connections in the current host connection pool, determining the number of connections currently in need of renewal; if the number of the idle connections is less than the number of the connections which need to be continued, taking out the overdue idle connections from the current host connection pool for continuing the continuation processing, for example, taking out the overdue idle connections from the current host connection pool, and continuing to keep the heartbeat connection between the idle connections and the opposite-end server; if the number of idle connections is greater than or equal to the number of connections currently in need of renewal, it is determined that a renewal process is not needed, e.g., the expired idle connections are deleted from the host connection pool.
For example, it is assumed that a current host connection pool maintains idle connections through a bidirectional queue, a head-of-queue element is obtained from the bidirectional queue, whether the head-of-queue element expires is determined according to the survival time of the head-of-queue element, if the head-of-queue element expires, the number of connections that need to be continued currently is determined, and if the number of idle connections in the current host connection pool is less than the number of connections that need to be continued currently, minActiveConnections are determined, it is determined that the expired head-of-queue element needs to be continued, that is, heartbeat connections between the idle connections of the head-of-queue element and an opposite-end server need to be maintained; and if the number of the idle connections is larger than or equal to the number of the current required continuation connections, determining that the continuation processing is not required, and deleting the queue head element from the bidirectional queue.
According to the technical solution in the example embodiment of fig. 2, on one hand, by determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool, and determining the number of current required renewal connections corresponding to the current host connection pool, the number of current required renewal connections corresponding to the current host connection pool can be dynamically determined in an elastic TPS scene; on the other hand, according to the number of idle connections and the number of connections which need to be continued currently, the number of idle connections of the host connection pool can be efficiently adjusted based on the current TPS condition, so that the stability of response time length can be ensured in an elastic TPS scene; on the other hand, as the current host connection pool can be ensured to have a certain long connection persistence, the time for establishing the connection between the client and the server can be reduced for a low TPS scene.
Fig. 3 is a flowchart for dynamically determining the number of currently required continuation connections according to an embodiment of the present disclosure.
Referring to fig. 3, in step S310, the number of idle connections and the number of waiting threads corresponding to the current host connection pool are obtained.
In an example embodiment, the current host connection pool may use a linked list to manage idle connections and wait thread queues for waiting for connections, and obtain the number of idle connections and the number of wait threads corresponding to the current host connection pool from the linked list.
It should be noted that other data structures, such as a queue or a bidirectional queue, may also be used to manage the idle connections and the waiting threads corresponding to the current host connection pool, and obtain the number of idle connections and the number of waiting threads corresponding to the current host connection pool from the queue or the bidirectional queue.
In step S320, if the number of waiting threads is greater than the predetermined threshold, it is determined that the number of currently required persistent connections of the current host connection pool is equal to the number of idle connections of the current host connection pool.
In an example embodiment, if the number of waiting threads is greater than a predetermined threshold, e.g., zero, it indicates that all the idle connections of the current host connection pool need to remain connected, and therefore, the number of currently required persistent connections of the current host connection pool is equal to the number of idle connections of the current host connection pool.
Further, in the example embodiment, if the number of waiting threads is greater than the predetermined threshold, for example, zero, it indicates that the connection capacity of the current host connection pool is small, and it is difficult to meet the processing requirement of the current client request, and therefore, it is necessary to perform capacity expansion processing on the connection capacity of the current host connection pool, for example, perform capacity expansion processing on the connection capacity of the current host connection pool according to a predetermined capacity expansion factor.
For example, assuming that the number of currently required continuation connections of the current host connection pool is minActiveConnections, the number of idle connections is freeconnections, i.e., the queue length of an idle queue of the host connection pool, the maximum number of connections, i.e., the connection capacity, is maxConnections, and the number of waiting threads is waitingthreads, i.e., the queue length of a waiting thread queue, the number of currently required continuation connections of the current host connection pool may be determined by the following rules:
if waitingthreads.size >0, minActiveConnections = freeconnections.size, and maxConnections = maxConnections 1.5, where the maximum value of the connection capacity of the current host connection pool is a fixed value, and 50,1.5 is a capacity expansion factor by default.
In step S330, if the number of currently waiting threads is equal to zero and the number of idle connections is equal to zero, it is determined that the number of currently required persistent connections of the current host connection pool remains unchanged.
In an example embodiment, if the number of currently waiting threads is equal to zero and the number of idle connections is equal to zero, it indicates that the connection capacity of the current host connection pool just meets the processing requirement of the current client request, and no capacity expansion or capacity reduction processing is required, so that it is determined that the number of currently required persistent connections of the current host connection pool remains unchanged. Further, the air conditioner is characterized in that, the number of currently required persistent connections for the current host connection pool may be determined by the following rules:
minActiveConnections = minactiveconductions if freeconnections.size = = 0and waitingthreads.size = =0, where the minimum number of free connections for the current host connection pool is a fixed value and the default value is 2.
In step S340, if the number of waiting threads is equal to zero and the number of idle connections is greater than zero, the reduction processing is performed on the number of currently required persistent connections of the current host connection pool by a predetermined reduction factor.
In an example embodiment, if the number of waiting threads is equal to zero and the number of idle connections is greater than zero, it indicates that the number of idle connections of the current host connection pool is greater, and it is necessary to perform capacity reduction on the idle connections of the current host connection pool. Further, the number of currently required persistent connections of the current host connection pool may be determined by the following rules:
if freesonnections.size >0and waitingthreads.size = =0, then the number of connections currently requiring renewal minActiveConnections =0.5 minActiveConnections, where 0.5 is the reduction factor and the minimum number of free connections for the current host connection pool is 1.
According to the technical solution in the example embodiment of fig. 3, on one hand, the data volume of the current host connection pool that needs to be continuously connected is dynamically determined based on the dynamic expansion and contraction capacity connection pool processing rule, so that the capacity of the current host connection pool can be efficiently adjusted based on the current TPS condition, and the performance stability of the connection pool system is ensured, thereby being capable of coping with a sudden traffic flood peak; on the other hand, the capacity of the current host connection pool can be adjusted based on the current TPS condition, so that the stability of response time can be ensured in an elastic TPS scene, and the waste of performance overhead of the connection pool system is avoided.
Fig. 4 is a schematic flow chart of another connection pool processing method provided in the embodiments of the present disclosure.
Referring to FIG. 4, in step S410, the head of queue element is taken out of the free connection queue of the host connection pool 110.
In an example embodiment, a plurality of host connection pools under the global connection pool ConnectionPool are traversed, and available bidirectional queues FreeConnections corresponding to the traversed current host connection pool 110 are determined. For FreeConnections bidirectional queues, the head-of-queue element is fetched and the live time of the head-of-queue element is analyzed based on the IdleConnectionHandler.
In step S420, it is determined whether the head of queue element is expired.
In the example embodiment, if the survival time exceeds the expiration time, it is determined that the idle connection corresponding to the head-of-queue element has expired, and step S430 is executed; if the survival time does not exceed the expiration time, it is determined that the idle connection corresponding to the head-of-line element is not expired, and the head-of-line element is placed back to the host connection pool 110.
In step S430, it is determined whether the number of idle connections is greater than or equal to the number of currently required renewal connections.
In an exemplary embodiment, if the number of idle connections is greater than or equal to the number of connections currently requiring continuation, i.e., the number of FreeConnections exceeds the number of minActiveConnections, it is determined that continuation is not required, and proceed to step S440; if the number of idle connections is less than the number of connections currently requiring continuation, it is determined that continuation is required, and the process proceeds to step S450.
In step S440, the head-of-line element is removed.
In an example embodiment, if the number of free connections is greater than or equal to the number of connections currently requiring continuation, it indicates that the head-of-queue element does not need to be continued, and the head-of-queue element is removed from the free connection queue of the host connection pool. Further, the global connection pool comprises an idle connection linked list corresponding to idle connections of the plurality of host connection pools, and a queue head element, namely a queue head idle connection, is removed from the idle connection linked list of the global connection pool.
For example, for expired idle connections, if no renewal is needed, the idle connections are removed from the queue, i.e., from the idle connection queue of the host connection pool, and from the idle connection list of the global connection pool.
In step S450, the first-queue element is subjected to the continuation processing.
In an example embodiment, a heartbeat connection between the idle connection corresponding to the head-of-queue element and the peer server 320 is established.
For example, for an expired idle connection, if a renewal is needed, the idle connection is taken out from the bidirectional queue of the host connection pool, a heartbeat connection is established with the peer server 320 (for example, there is an expiration time for the peer service), and then a connection release or releaseConnection operation is performed.
In step S460, the head-of-line element is removed and added to the tail of the line.
In an example embodiment, for an expired idle connection, after releasing the idle connection, the idle connection is removed from the bidirectional queue and added to the tail of the bidirectional queue, that is, the idle connection is taken out of the bidirectional queue and removed, the idle connection is released after establishing a heartbeat connection with the peer server 320, and the idle connection is added to the tail of the bidirectional queue. And further, adding the idle connection to the tail end of the idle connection linked list of the global connection pool. The bidirectional queues of the host connection pool are cached in cache 330.
In step S470, the traversal continues to the next connection in the connection pool.
According to the technical solution in the example embodiment of fig. 4, on one hand, the two-way queue and the LRU (Least Recently Used) algorithm are comprehensively utilized to perform the renewal, closing, and acquisition management of the idle connection of the connection pool, so that the connection pool can be ensured to have a certain number of effective long connections, and the time for establishing connection between the client and the server can be reduced for a low TPS scene; on the other hand, the expired connection can be automatically cleared, and the effectiveness of the idle connection is ensured.
In addition, in some example embodiments, if the number of idle connections is greater than or equal to the number of currently required continuation connections, the number of idle connections of the currently required continuation connections is taken from the tail of the bidirectional queue for continuation processing, that is, connections exceeding the number of currently required continuation connections are removed from the head of the bidirectional queue, and the remaining idle connections are continued. For example, if the number of idle connections is 100 and the number of connections currently requiring to be continued is 30, 30 idle connections may be taken from the tail of the bidirectional queue for continuing, and if none of the 30 idle connections expires, no continuation processing is needed, or 70 connections are removed from the head of the bidirectional queue and the remaining 30 idle connections are continued.
According to the technical scheme in the embodiment, when the number of idle connections is far larger than the number of connections needing to be continuously contracted currently, the connections exceeding the number of connections needing to be continuously contracted currently are removed, so that the system performance overhead of the connection pool can be reduced based on the size of the dynamic capacity reduction connection pool of the current TPS scene.
Fig. 5 is a schematic diagram of modules of a connection pool processing apparatus according to an embodiment of the present disclosure.
Referring to fig. 5, the connection pool processing apparatus includes a client request management class 510, where the client request management class 510 is configured to process a received connection obtaining request of a client, and the client request management class 510 includes: an idle continuation processing class 512, an idle connection processing class 514, and a global connection pool 516.
The idle continuation processing class 512, i.e., idleRenewWorker, is used to process the expiration and continuation of the idle connection of the connection pool, for example, whether the idle connection of the connection pool is expired and whether the continuation is processed through a continuation and expiration function renew and expire (). The idle connection handling class 514, i.e., idleConnectionHandler, includes idle connections maintained by a Map data structure, where the key is idle connection http connection and the value is the survival time corresponding to the idle connection.
The global connection pool 516 includes a plurality of host connection pools and a plurality of free connections, linkdedlist < http connection >, maintained through a linked list, the global connection pool 516 and the host connection pools are in a one-to-many relationship, i.e. 1: the relationship of N. The host connection pool corresponding to the global connection pool 516 is maintained by a Map data structure, wherein the key is host configuration 518, namely, hostConfiguration, and the value is host connection pool HostConnectionPool. Host configuration 518 includes host HttpHost and proxy ProxyHost.
The host connection pool 520 includes a free connection queue Deque and a waiting thread list linkedlst. The continuation calculation processing class 522, activecalcWorker, is used to calculate the number of currently required continuation connections and whether or not the free connections in the free connection queue need to be continued, for example, by calculating function calc (), the number of currently required continuation connections in the connection pool connectionPool and whether or not the free connections in the free connection queue need to be continued are calculated.
Further, in the example embodiment, (1) traverse the host connection pool 520 under the current global connection pool 516ConnectionPool, to obtain a bidirectional queue of available free connections FreeConnections for the host connection pool 520. (2) For the bidirectional queue Deque of the idle connection, a queue head element is taken, the survival time of the idle connection corresponding to the queue head element is analyzed based on the idle connection processing class 514, i.e. the idleConnectionHandler, and if the survival time exceeds the expiration time, the steps (3) and (4) are carried out. (3) Determining that the queue head element does not need to be continued for the condition that the number of the idle connections is larger than or equal to the number minActiveConnections of the current required connection; for the case that the number of free connections is less than the current number of required continuation connections minActiveConnections, it is determined that the head-of-line element requires continuation. (4) If the idle connection corresponding to the queue head element is expired, if the idle connection needs to be renewed, removing the queue head element in the host thread pool, performing opposite-end service heartbeat connection (if the opposite-end service has expired time), then executing connection release releseconnection operation, adding the queue head element connection into the tail of the bidirectional queue again (namely, placing the element at the tail of the queue after normal use and release), and adding the queue head element into the tail of a spatial connection linked list LinkedList. (5) If the free connection corresponding to the head of queue element is expired, if no renewal is needed, the free connection corresponding to the head of queue element is directly removed from the queue, namely, the free connection is removed from the linked list of the global connection pool ConnectionPool and removed from the bidirectional queue of the host connection pool HostConnectionPool.
Further, in an example embodiment, the number of currently required renewal connections corresponding to the current host connection pool may be dynamically determined according to the number of idle connections and the number of waiting threads corresponding to the current host connection pool.
For example, if the number of the current waiting threads is greater than a predetermined threshold, for example, greater than zero, it is determined that the number of the current persistent connections of the current host connection pool is equal to the number of the idle connections of the current host connection pool; if the number of the current waiting threads is equal to zero and the number of the idle connections is equal to zero, determining that the number of the current continuous connections required by the current host connection pool is kept unchanged; and if the number of the waiting threads is equal to zero and the number of the idle connections is greater than zero, carrying out capacity reduction processing on the number of the current continuous connections of the current host connection pool according to a preset capacity reduction factor.
For example, assuming that the number of currently required persistent connections of the current host connection pool is minActiveConnections, the number of idle connections is freeconnections, size is queue length of an idle queue of the host connection pool, the maximum number of connections, i.e., connection capacity, is maxConnections, and the number of waiting threads is waitingthreads, size is queue length of a waiting thread queue, the number of currently required persistent connections of the current host connection pool can be determined by the following rules:
(1) If waitingthreads.size >0, minActiveConnections = freeconnections.size, and maxConnections = maxConnections 1.5, where the maximum value of the connection capacity of the current host connection pool is a fixed value, and 50,1.5 is a capacity expansion factor by default.
(2) minActiveConnections = minactiveconductions if freeconnections.size = = 0and waitingthreads.size = =0, where the minimum number of free connections for the current host connection pool is a fixed value and the default value is 2.
(3) If freesonnections.size >0and waitingthreads.size = =0, then the number of connections currently requiring renewal minActiveConnections =0.5 minActiveConnections, where 0.5 is the reduction factor and the minimum number of free connections for the current host connection pool is 1.
According to the technical solution in the example embodiment of fig. 5, on one hand, the two-way queue and the LRU algorithm are comprehensively utilized to perform the renewal, closing and acquisition management of the idle connection of the connection pool, so that the connection pool can be ensured to have a certain number of effective long connections, and the time for establishing connection between the client and the server can be reduced for a low TPS scene; on the other hand, the capacity of the current host connection pool can be adjusted based on the current TPS condition, so that the stability of response time can be ensured in an elastic TPS scene, and the waste of performance overhead of the connection pool system is avoided; on the other hand, the data volume of the current host connection pool which needs to be continuously connected is dynamically determined in real time based on the dynamic expansion and contraction capacity connection pool processing rule, the capacity of the current host connection pool can be efficiently adjusted based on the current TPS condition, the performance stability of the connection pool system is ensured, and therefore sudden flow flood peaks can be responded.
Based on the system architecture shown in fig. 1, the connection pool processing apparatus provided in the embodiment of the present disclosure will be described in detail below with reference to fig. 6. It should be noted that, the connection pool processing apparatus in fig. 6 is used for executing the method of the embodiment shown in fig. 2 to fig. 4 in this specification, for convenience of description, only the portion related to the embodiment in this specification is shown, and specific technical details are not disclosed, please refer to the embodiment shown in fig. 2 to fig. 4 in this specification.
Referring to fig. 6, a schematic structural diagram of a connection pool processing apparatus is provided for the embodiment of the present disclosure. As shown in fig. 6, the connection pool processing apparatus 600 of the embodiment of the present specification may include: a traffic determination module 610, a renewal quantity determination module 620, and a renewal processing module 630. Wherein the content of the first and second substances,
a traffic determining module 610, configured to determine the number of idle connections and the number of waiting threads corresponding to the current host connection pool;
a number-of-renewals determining module 620, configured to determine, according to the number of idle connections and the number of waiting threads, a number of currently-required-renewals connections corresponding to the current host connection pool;
a continuation processing module 630, configured to perform continuation processing on the idle connections of the current host connection pool according to the number of idle connections and the number of currently required continuation connections.
In some example embodiments, based on the above, the continuation quantity determination module 620 is configured to:
if the number of the waiting threads is larger than a preset threshold value, determining that the number of the current continuous connections of the current host connection pool is equal to the number of the idle connections of the current host connection pool.
In some example embodiments, based on the above scheme, the apparatus 600 further includes:
and the capacity expansion processing module is used for carrying out capacity expansion processing on the connection capacity of the current host connection pool according to a preset capacity expansion factor.
In some example embodiments, based on the foregoing scheme, the capacity expansion processing module includes:
a connection capacity determining module, configured to determine, according to the number of service domain names in the current host connection pool and the current number of transactions per second TPS, a connection capacity of the current host connection pool;
and the capacity expansion unit is used for carrying out capacity expansion processing on the connection capacity of the current host connection pool according to a preset capacity expansion factor.
In some example embodiments, based on the above, the continuation quantity determination module 620 is configured to:
if the number of waiting threads is equal to zero and the number of idle connections is equal to zero, determining that the number of currently required persistent connections of the current host connection pool remains unchanged.
In some example embodiments, based on the above, the continuation quantity determination module 620 is configured to:
and if the number of the waiting threads is equal to zero and the number of the idle connections is greater than zero, performing capacity reduction processing on the number of the current required renewal connections of the current host connection pool according to a preset capacity reduction factor.
In some exemplary embodiments, based on the above scheme, the continuation processing module 630 includes:
a number of persistent connections obtaining unit, configured to obtain the number of connections that need to be persistent if an expired idle connection exists in the current host connection pool;
and a renewal processing unit, configured to, if the number of idle connections is less than the number of connections that need to be renewed currently, take out the expired idle connections from the current host connection pool to perform renewal processing.
In some example embodiments, based on the above scheme, the current host connection pool maintains the idle connection through a bidirectional queue, and the continuation number obtaining unit is configured to:
taking out the free connection at the head of the queue from the bidirectional queue, and determining the survival time of the free connection at the head of the queue;
if the queue head free connection is determined to be expired based on the survival time, acquiring the number of the current required persistent connections,
the renewal processing unit is configured to:
establishing heartbeat connection between the queue head idle connection and an opposite-end server;
removing the head-of-line free connection from the bidirectional queue;
and adding the free connection at the head of the queue to the tail of the bidirectional queue.
In some example embodiments, based on the above scheme, the traffic determination module 610 is configured to:
and traversing a plurality of host connection pools under the global connection pool, and determining the number of idle connections corresponding to the traversed current host connection pool and the number of waiting threads.
In some example embodiments, based on the foregoing solution, the global connection pool includes a free connection linked list corresponding to free connections of the multiple host connection pools, and after the adding the head-of-queue free connection to the tail of the bidirectional queue, the apparatus further includes:
and the element adding unit is used for adding the queue head idle connection to the tail of the idle connection linked list of the global connection pool after adding the queue head idle connection to the tail of the bidirectional queue.
In some example embodiments, based on the above scheme, the apparatus further includes: a removing module, configured to determine that a renewal process is not needed if the number of idle connections is greater than or equal to the number of currently-required renewal connections; removing the head-of-line free connection from the bidirectional queue; and removing the queue head idle connection from the idle connection linked list of the global connection pool.
According to the technical solution of the embodiment of fig. 6 in the present specification, on one hand, by determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool, and determining the number of current required renewal connections corresponding to the current host connection pool, the number of current required renewal connections corresponding to the current host connection pool can be dynamically determined in an elastic TPS scene; on the other hand, according to the number of idle connections and the number of connections which need to be continued currently, the number of idle connections of the host connection pool can be efficiently adjusted based on the current TPS condition, so that the stability of response time length can be ensured in an elastic TPS scene; on the other hand, as a certain long connection persistence can be ensured, the time for establishing the connection between the client and the server can be reduced for a low TPS scene.
The above is a schematic scheme of a connection pool processing device according to an embodiment of the present specification. It should be noted that the technical solution of the connection pool processing apparatus and the technical solution of the connection pool processing method belong to the same concept, and details of the technical solution of the connection pool processing apparatus, which are not described in detail, can be referred to the description of the technical solution of the connection pool processing method.
An embodiment of this specification further provides a computer storage medium, where the computer storage medium may store a plurality of program instructions, where the program instructions are suitable for being loaded by a processor and executing the method steps in the embodiments shown in fig. 2 to 4, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 2 to 4, which is not described herein again.
An embodiment of the present specification further provides a computer program product, where the computer program product stores at least one instruction, and the at least one instruction is loaded by the processor and executes the connection pool processing method according to the embodiment shown in fig. 2 to 4, where a specific execution process may refer to a specific description of the embodiment shown in fig. 2 to 4, and is not described herein again.
Referring to fig. 7, a schematic structural diagram of an electronic device provided in an exemplary embodiment of the present disclosure is shown. The electronic device in this specification may include one or more of the following components: a processor 710, a memory 720, an input device 730, an output device 740, and a bus 750. The processor 710, the memory 720, the input device 730, and the output device 740 may be connected by a bus 750.
Processor 710 may include one or more processing cores. The processor 710 interfaces with various components throughout the electronic device using various interfaces and lines to perform various functions of the electronic device 700 and process data by executing or performing instructions, programs, code sets, or instruction sets stored in the memory 720 and invoking data stored in the memory 720. Alternatively, the processor 710 may be implemented in hardware using at least one of Digital Signal Processing (DSP), field-programmable gate Array (FPGA), and Programmable Logic Array (PLA). The processor 710 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 710, but may be implemented by a communication chip.
The Memory 720 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 720 includes a non-transitory computer-readable medium. The memory 720 may be used to store instructions, programs, code sets, or instruction sets. The memory 720 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like, and the operating system may be an Android (Android) system, including a system based on Android system depth development, an IOS system developed by apple, including a system based on IOS system depth development, or other systems.
In order to enable the operating system to distinguish a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.
The input device 730 is used for receiving input commands or data, and the input device 730 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. Output devices 740 are used to output instructions or data, and output devices 740 include, but are not limited to, a display device, a speaker, and the like. In one example, the input device 730 and the output device 740 may be combined, and the input device 730 and the output device 740 are touch display screens.
In addition, those skilled in the art will appreciate that the configurations of the electronic devices illustrated in the above-described figures do not constitute limitations on the electronic devices, which may include more or fewer components than illustrated, or some components may be combined, or a different arrangement of components. For example, the electronic device further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a Wireless Fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the electronic device shown in fig. 7, the processor 710 may be configured to invoke the connection pool processing application program stored in the memory 720, and specifically perform the following operations:
determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool;
determining the number of current required renewal connections corresponding to the current host connection pool according to the number of the idle connections and the number of the waiting threads;
and performing reservation processing on the idle connections of the current host connection pool according to the number of the idle connections and the number of the current connections needing to be reserved.
In some example embodiments, when the processor 710 determines the number of current renewal connections corresponding to the current host connection pool according to the number of idle connections and the number of waiting threads, specifically perform the following operations:
if the number of the waiting threads is larger than a preset threshold value, determining that the number of the current continuous connections of the current host connection pool is equal to the number of the idle connections of the current host connection pool.
In some example embodiments, processor 710 also performs the following operations:
and carrying out capacity expansion processing on the connection capacity of the current host connection pool according to a preset capacity expansion factor.
In some example embodiments, when performing the capacity expansion processing on the connection capacity of the current host connection pool according to the predetermined capacity expansion factor, the processor 710 specifically performs the following operations:
determining the connection capacity of the current host connection pool according to the number of the service domain names of the current host connection pool and the current number of Transactions Per Second (TPS);
and carrying out capacity expansion processing on the connection capacity of the current host connection pool according to the preset capacity expansion factor.
In some example embodiments, when the processor 710 determines the number of current renewal connections corresponding to the current host connection pool according to the number of idle connections and the number of waiting threads, specifically perform the following operations:
if the number of waiting threads is equal to zero and the number of idle connections is equal to zero, determining that the number of currently required persistent connections of the current host connection pool remains unchanged.
In some example embodiments, when the processor 710 determines the number of currently required renewal connections corresponding to the current host connection pool according to the number of idle connections and the number of waiting threads, specifically perform the following operations:
and if the number of the waiting threads is equal to zero and the number of the idle connections is greater than zero, performing capacity reduction processing on the number of the current required renewal connections of the current host connection pool according to a preset capacity reduction factor.
In some example embodiments, when the processor 710 performs the resignation processing on the idle connections of the current host connection pool according to the number of idle connections and the number of currently required resignation connections, specifically perform the following operations:
if the current host connection pool has overdue idle connections, acquiring the number of the current connections needing to be continued;
and if the number of the idle connections is less than the number of the current connections needing to be renewedly processed, taking out the overdue idle connections from the current host connection pool to be renewed.
In some example embodiments, when the processor 710 executes the maintaining of the idle connections through the bidirectional queue in the current host connection pool, and if there are expired idle connections in the current host connection pool, and acquires the number of the current connections that need to be continued, the following operations are specifically executed:
taking out the free connection at the head of the queue from the bidirectional queue, and determining the survival time of the free connection at the head of the queue;
if the queue head free connection is determined to be expired based on the survival time, acquiring the number of the current required persistent connections,
the taking out of the idle connection from the current host connection pool for continuation processing includes:
establishing heartbeat connection between the queue head idle connection and an opposite-end server;
removing the head-of-line free connection from the bidirectional queue;
and adding the free connection at the head of the queue to the tail of the bidirectional queue.
In some example embodiments, when performing the determining of the number of idle connections and the number of waiting threads corresponding to the current host connection pool, the processor 710 specifically performs the following operations:
and traversing a plurality of host connection pools under the global connection pool, and determining the number of idle connections corresponding to the traversed current host connection pool and the number of waiting threads.
In some example embodiments, the global connection pool comprises a linked list of free connections corresponding to free connections of the plurality of host connection pools, and after the adding the head-of-queue free connection to the end-of-queue of the bidirectional queue, processor 710 further performs the following:
and adding the queue head idle connection to the tail of the idle connection linked list of the global connection pool.
In some example embodiments, processor 710 also performs the following operations:
if the number of the idle connections is larger than or equal to the number of the current connections needing to be subjected to the continuation processing, determining that the continuation processing is not needed;
removing the head-of-line free connection from the bidirectional queue;
and removing the queue head idle connection from the idle connection linked list of the global connection pool.
According to the technical solution of the embodiment of fig. 7 in this specification, on one hand, by determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool, the number of current required renewal connections corresponding to the current host connection pool is determined, and the number of current required renewal connections corresponding to the current host connection pool can be dynamically determined in an elastic TPS scene; on the other hand, according to the number of idle connections and the number of connections which need to be continued currently, the number of idle connections of the host connection pool can be efficiently adjusted based on the current TPS condition, so that the stability of response time length can be ensured in an elastic TPS scene; on the other hand, as a certain long connection persistence can be ensured, the time for establishing the connection between the client and the server can be reduced for a low TPS scene.
The foregoing is a schematic view of an electronic device according to an embodiment of the present specification. It should be noted that the technical solution of the electronic device and the technical solution of the connection pool processing method belong to the same concept, and details that are not described in detail in the technical solution of the electronic device can be referred to the description of the technical solution of the connection pool processing method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium of the computer program may be a magnetic disk, an optical disk, a read-only memory or a random access memory.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present disclosure, and it is not intended to limit the scope of the present disclosure, so that the present disclosure will be covered by the claims and their equivalents.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Claims (15)

1. A connection pool processing method, comprising:
determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool;
determining the number of current required renewal connections corresponding to the current host connection pool according to the number of the idle connections and the number of the waiting threads;
and performing reservation processing on the idle connections of the current host connection pool according to the number of the idle connections and the number of the current connections needing to be reserved.
2. The method of claim 1, wherein said determining a number of current on-demand connections corresponding to the current host connection pool based on the number of idle connections and the number of waiting threads comprises:
if the number of the waiting threads is larger than a preset threshold value, determining that the number of the current continuous connections of the current host connection pool is equal to the number of the idle connections of the current host connection pool.
3. The method of claim 2, wherein the method further comprises:
and carrying out capacity expansion processing on the connection capacity of the current host connection pool according to a preset capacity expansion factor.
4. The method of claim 3, wherein the expanding the connection capacity of the current host connection pool according to a predetermined expansion factor includes:
determining the connection capacity of the current host connection pool according to the number of the service domain names of the current host connection pool and the current number of Transactions Per Second (TPS);
and carrying out capacity expansion processing on the connection capacity of the current host connection pool according to the preset capacity expansion factor.
5. The method of claim 1, wherein said determining a number of currently required renewal connections corresponding to the current host connection pool based on the number of idle connections and the number of waiting threads comprises:
if the number of the waiting threads is equal to zero and the number of the idle connections is equal to zero, determining that the number of the current continuous connections of the current host connection pool keeps unchanged.
6. The method of claim 1, wherein the determining the number of current renewal connections corresponding to the current host connection pool according to the number of idle connections and the number of waiting threads comprises:
and if the number of the waiting threads is equal to zero and the number of the idle connections is greater than zero, performing capacity reduction processing on the number of the current required renewal connections of the current host connection pool according to a preset capacity reduction factor.
7. The method according to any one of claims 1 to 6, wherein the performing a provisioning process on the idle connections of the current host connection pool according to the number of idle connections and the number of currently required provisioning connections comprises:
if the current host connection pool has overdue idle connections, acquiring the number of the current connections needing to be continued;
and if the number of the idle connections is less than the number of the current connections needing to be renewed, taking out the overdue idle connections from the current host connection pool for renewal treatment.
8. The method of claim 7, wherein the maintaining of the idle connections by the current host connection pool via a bidirectional queue, and the obtaining of the number of the currently required persistent connections if there are expired idle connections in the current host connection pool comprises:
taking out the free connection at the head of the queue from the bidirectional queue, and determining the survival time of the free connection at the head of the queue;
if the queue head free connection is determined to be expired based on the survival time, acquiring the number of the current required persistent connections,
the taking out of the idle connection from the current host connection pool for continuation processing includes:
establishing heartbeat connection between the queue head idle connection and an opposite-end server;
removing the head-of-line free connection from the bidirectional queue;
and adding the free connection at the head of the queue to the tail of the bidirectional queue.
9. The method of claim 8, wherein the determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool comprises:
and traversing a plurality of host connection pools under the global connection pool, and determining the number of idle connections corresponding to the traversed current host connection pool and the number of waiting threads.
10. The method of claim 9, wherein the global connection pool comprises a linked list of free connections corresponding to free connections of the plurality of host connection pools, the method further comprising, after the adding the head-of-queue free connection to the tail of the bidirectional queue:
and adding the queue head idle connection to the tail of the idle connection linked list of the global connection pool.
11. The method of claim 10, wherein the method further comprises:
if the number of the idle connections is larger than or equal to the number of the current connections needing to be subjected to the renewal, determining that the renewal processing is not needed;
removing the head-of-line free connection from the bidirectional queue;
and removing the queue head idle connection from the idle connection linked list of the global connection pool.
12. A connection tank processing apparatus comprising:
the traffic determining module is used for determining the number of idle connections and the number of waiting threads corresponding to the current host connection pool;
a number of continuation connections determining module, configured to determine, according to the number of idle connections and the number of waiting threads, a number of current required continuation connections corresponding to the current host connection pool;
and the continuation processing module is used for continuing the idle connections of the current host connection pool according to the number of the idle connections and the number of the current connections needing to be continued.
13. A computer storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor and to carry out the steps of the method according to any of claims 1 to 11.
14. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the method according to any of claims 1 to 11.
15. A computer program product comprising instructions for causing a computer or processor to carry out the steps of the method according to any one of claims 1 to 11 when the computer program product is run on the computer or processor.
CN202211050306.9A 2022-08-30 2022-08-30 Connection pool processing method and device, storage medium and equipment Pending CN115396486A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211050306.9A CN115396486A (en) 2022-08-30 2022-08-30 Connection pool processing method and device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211050306.9A CN115396486A (en) 2022-08-30 2022-08-30 Connection pool processing method and device, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN115396486A true CN115396486A (en) 2022-11-25

Family

ID=84124323

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211050306.9A Pending CN115396486A (en) 2022-08-30 2022-08-30 Connection pool processing method and device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN115396486A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346767A (en) * 2011-09-19 2012-02-08 北京金和软件股份有限公司 Database connection method based on double connection pools
WO2012024909A1 (en) * 2010-08-27 2012-03-01 中兴通讯股份有限公司 Long connection management apparatus and link resource management method for long connection communication
CN103605727A (en) * 2013-11-19 2014-02-26 浪潮电子信息产业股份有限公司 Connection pool based efficient multiuser database access optimization method and framework
CN110289993A (en) * 2019-06-06 2019-09-27 阿里巴巴集团控股有限公司 A kind of connection pool management method, apparatus, equipment and adapting system
CN112689008A (en) * 2020-12-23 2021-04-20 百果园技术(新加坡)有限公司 Network connection pool management method, device, equipment and storage medium
CN114490030A (en) * 2021-12-24 2022-05-13 新奥新智科技有限公司 Method and device for realizing self-adaptive dynamic redis connection pool

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012024909A1 (en) * 2010-08-27 2012-03-01 中兴通讯股份有限公司 Long connection management apparatus and link resource management method for long connection communication
CN102346767A (en) * 2011-09-19 2012-02-08 北京金和软件股份有限公司 Database connection method based on double connection pools
CN103605727A (en) * 2013-11-19 2014-02-26 浪潮电子信息产业股份有限公司 Connection pool based efficient multiuser database access optimization method and framework
CN110289993A (en) * 2019-06-06 2019-09-27 阿里巴巴集团控股有限公司 A kind of connection pool management method, apparatus, equipment and adapting system
CN112689008A (en) * 2020-12-23 2021-04-20 百果园技术(新加坡)有限公司 Network connection pool management method, device, equipment and storage medium
CN114490030A (en) * 2021-12-24 2022-05-13 新奥新智科技有限公司 Method and device for realizing self-adaptive dynamic redis connection pool

Similar Documents

Publication Publication Date Title
CN110289993B (en) Connection pool management method, device, equipment and switching system
CN107864391B (en) Video stream cache distribution method and device
WO2017032152A1 (en) Method for writing data into storage device and storage device
CN113067875A (en) Access method, device and equipment based on dynamic flow control of micro-service gateway
CN110851276A (en) Service request processing method, device, server and storage medium
CN113934530A (en) Multi-core multi-queue task cross processing method, device, system and storage medium
CN115396486A (en) Connection pool processing method and device, storage medium and equipment
CN111177032A (en) Cache space application method, system, device and computer readable storage medium
CN114785861B (en) Service request forwarding system, method, computer equipment and storage medium
CN116149841A (en) Processor resource dynamic superdivision method based on cloud database instance load
CN110912958A (en) HTTP connection processing method, device, equipment and medium
CN115145905A (en) Data processing method, system, electronic equipment and readable storage medium
CN111857992B (en) Method and device for allocating linear resources in Radosgw module
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
JP2019526860A (en) Scalable real-time messaging system
CN112685156A (en) Task execution method and device, electronic equipment and computer readable medium
JP2014174597A (en) In-memory distributed database, data distribution method, and program
JP2018538632A (en) Method and device for processing data after node restart
US8046543B2 (en) Selectively retaining a topmost subpool expansion to prevent thrashing
CN109905443B (en) Data processing method, system, electronic device and computer readable medium
CN114296916B (en) Method, device and medium for improving RDMA release performance
CN111401541A (en) Data transmission control method and device
CN110955461A (en) Processing method, device and system of computing task, server and storage medium
TWI710954B (en) Data caching method for hyper converged infrastructure and node performing the same, machine learning framework, and file system client
CN113783728A (en) Connection optimization method and device, computing equipment and computer storage medium

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