CN107632919B - Database monitoring method and device - Google Patents

Database monitoring method and device Download PDF

Info

Publication number
CN107632919B
CN107632919B CN201710779639.8A CN201710779639A CN107632919B CN 107632919 B CN107632919 B CN 107632919B CN 201710779639 A CN201710779639 A CN 201710779639A CN 107632919 B CN107632919 B CN 107632919B
Authority
CN
China
Prior art keywords
database
data operation
operation request
monitoring
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.)
Active
Application number
CN201710779639.8A
Other languages
Chinese (zh)
Other versions
CN107632919A (en
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710779639.8A priority Critical patent/CN107632919B/en
Publication of CN107632919A publication Critical patent/CN107632919A/en
Application granted granted Critical
Publication of CN107632919B publication Critical patent/CN107632919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The disclosure relates to a database monitoring method and device. The method is applied to the proxy server and comprises the following steps: when a data operation request of a client for a database is received, connecting the database; when the database is successfully connected, forwarding a data operation request to the database; recording first monitoring information associated with establishing a connection with the database, wherein the first monitoring information comprises at least one of: connection duration information for establishing connection with the database and first state information of the database. According to the embodiment of the method and the device, the proxy server is connected with the database when receiving the data operation request of the client aiming at the database, forwards the data operation request to the database when the connection is successful, and records the first monitoring information associated with the connection establishment of the database, so that the fine monitoring of the operation link of the database is realized.

Description

Database monitoring method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a database monitoring method and apparatus.
Background
With the rapid development of computer and network technologies, databases are widely used in various fields to provide operation functions such as query, addition, modification, deletion and the like for various applications and services. More and more applications and services place higher demands on the response time of the database (e.g., the connection time for establishing a connection with the database), the performance of the database, and the like. Therefore, each operation link of the database needs to be carefully monitored.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a database monitoring method and apparatus.
According to a first aspect of the embodiments of the present disclosure, there is provided a database monitoring method, which is applied in a Proxy (Proxy) server, and includes:
when a data operation request of a client for a database is received, connecting the database;
when the database is successfully connected, forwarding the data operation request to the database;
recording first monitoring information associated with establishing a connection with the database,
wherein the first monitoring information comprises at least one of:
connection duration information for establishing connection with the database and first state information of the database.
For the above method, in one possible implementation, the method further includes:
recording second monitoring information associated with establishing a connection with the database upon a failure to connect the database,
wherein the second monitoring information comprises second status information of the database.
For the above method, in one possible implementation, the method further includes:
when a response of the database to the data operation request is received, forwarding the response to the client;
recording third monitoring information associated with the database return response,
wherein the third monitoring information comprises at least one of:
the operation duration information of the database and the third state information of the database.
For the above method, in one possible implementation, the method further includes:
when the response of the database to the data operation request cannot be received, recording fourth monitoring information associated with the response returned by the database,
wherein the fourth monitoring information includes fourth status information of the database.
For the above method, in one possible implementation, the method further includes:
determining a monitoring mode for the data operation request according to the characteristics of the data operation request,
wherein recording first monitoring information associated with establishing a connection with the database comprises:
recording first monitoring information associated with establishing a connection with the database for a data operation request conforming to the monitoring mode,
wherein the characteristics of the data operation request include at least one of:
a type of the data operation request and a number of the data operation requests.
For the above method, in a possible implementation manner, when a data operation request of a client for a database is received, connecting the database includes:
when a data operation request of a client for a database is received, determining load states of a plurality of databases;
determining databases to be connected according to the load states of the databases;
and connecting the databases to be connected.
According to a second aspect of the embodiments of the present disclosure, there is provided a database monitoring apparatus including:
the connection module is used for connecting the database when receiving a data operation request of a client aiming at the database;
the request forwarding module is used for forwarding the data operation request to the database when the database is successfully connected;
a first recording module for recording first monitoring information associated with establishing a connection with the database,
wherein the first monitoring information comprises at least one of:
connection duration information for establishing connection with the database and first state information of the database.
For the above apparatus, in one possible implementation, the apparatus further includes:
a second recording module for recording second monitoring information associated with the establishment of the connection with the database when the connection with the database fails,
wherein the second monitoring information comprises second status information of the database.
For the above apparatus, in one possible implementation, the apparatus further includes:
the response forwarding module is used for forwarding a response of the database to the data operation request to the client when the response is received;
a third recording module for recording third monitoring information associated with the database return response,
wherein the third monitoring information comprises at least one of:
the operation duration information of the database and the third state information of the database.
For the above apparatus, in one possible implementation, the apparatus further includes:
a fourth recording module, configured to record fourth monitoring information associated with a response returned by the database when a response to the data operation request by the database cannot be received,
wherein the fourth monitoring information includes fourth status information of the database.
For the above apparatus, in one possible implementation, the apparatus further includes:
a determining module for determining a monitoring mode for the data operation request according to the characteristics of the data operation request,
wherein, the first record module includes:
a first recording sub-module for recording first monitoring information associated with establishing connection with the database for data operation request conforming to the monitoring mode,
wherein the characteristics of the data operation request include at least one of:
a type of the data operation request and a number of the data operation requests.
For the above apparatus, in one possible implementation, the connection module includes:
the first determining submodule is used for determining the load states of the plurality of databases when a data operation request of a client for the databases is received;
the second determining submodule is used for determining the databases to be connected according to the load states of the databases;
and the connecting submodule is used for connecting the databases to be connected.
According to a third aspect of the embodiments of the present disclosure, there is provided a database monitoring apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the above method.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor, enable the processor to perform the above-mentioned database monitoring method.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: the database is connected when a data operation request of a client aiming at the database is received, the data operation request is forwarded to the database when the connection is successful, and first monitoring information associated with the connection establishment of the database is recorded, so that the fine monitoring of the operation link of the database is realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a database monitoring method according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating step S11 of a database monitoring method according to an exemplary embodiment.
FIG. 3 is a flow chart illustrating a database monitoring method according to an exemplary embodiment.
FIG. 4 is a flow chart illustrating a database monitoring method according to an exemplary embodiment.
FIG. 5 is a flow chart illustrating a database monitoring method according to an exemplary embodiment.
FIG. 6 is a flow chart illustrating a database monitoring method according to an exemplary embodiment.
Fig. 7 is a schematic diagram illustrating an application scenario of a database monitoring method according to an exemplary embodiment.
FIG. 8 is a block diagram illustrating a database monitoring apparatus according to an exemplary embodiment.
FIG. 9 is a block diagram illustrating a database monitoring apparatus according to an exemplary embodiment.
FIG. 10 is a block diagram illustrating a database monitoring apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
FIG. 1 is a flow chart illustrating a database monitoring method according to an exemplary embodiment. As shown in fig. 1, the method is applied to a proxy server. The database monitoring method according to the embodiment of the disclosure comprises the following steps:
in step S11, when a data operation request of a client for a database is received, connecting the database;
in step S12, when the database is successfully connected, forwarding the data operation request to the database;
in step S13, first monitoring information associated with the database establishment connection is recorded,
wherein the first monitoring information comprises at least one of:
connection duration information for establishing connection with the database and first state information of the database.
According to the embodiment of the disclosure, the proxy server is connected with the database when receiving the data operation request of the client aiming at the database, forwards the data operation request to the database when the connection is successful, and records the first monitoring information associated with the connection establishment of the database, thereby realizing the fine monitoring (namely, fine-grained monitoring) of each operation link of the database.
For example, a set of proxy servers may be built on top of a plurality of databases (e.g., a database cluster), and the proxy servers may receive data operation requests (read data requests, write data requests, etc.) from clients to the databases. For example, the proxy server may receive a data operation request from a client for a database and connect to the database upon receiving the data operation request. Those skilled in the art should understand that the proxy server may be built on top of a plurality of databases by using implementations known in the art, as long as the proxy server can receive a data operation request of a client for a database and connect to the database, which is not limited by the present disclosure.
Fig. 2 is a flowchart illustrating step S11 of a database monitoring method according to an exemplary embodiment. In one possible implementation, as shown in fig. 2, step S11 may include:
in step S111, upon receiving a data operation request from a client for a database, determining load states of a plurality of databases;
in step S112, determining a database to be connected according to the load states of the plurality of databases;
in step S113, the databases to be connected are connected.
For example, a database cluster may include a plurality of databases, e.g., the database cluster may include 1 master database and 4 slave databases. The proxy server can determine the load conditions of a plurality of databases when receiving data operation requests of the client to the databases. For example, the master database of the database cluster is responsible for data writing operation, the slave database is responsible for data reading operation, and when the proxy server receives the data reading operation of the client to the database, the load conditions of 4 slave databases can be determined. For example, information on the number of processes, processing power, and the like of 4 slave databases may be determined. And, the proxy server may determine the databases to be connected according to the load states of the plurality of databases, for example, 4 slave databases, where the processing amount of the slave database 1 and the slave database 2 is too large, and the slave database 4 often returns a data exception, and at this time, the proxy server may determine that the databases to be connected are the slave database 3. After determining the database to be connected, a connection may be established with the database to be connected.
In this way, the proxy server can be combined with the load balance and high availability of the database to realize mutual monitoring. Those skilled in the art will appreciate that the load balancing, high availability combination of the proxy server and the database may be achieved by the related art, and the disclosure is not limited thereto.
As shown in fig. 1, in step S12, when the database is successfully connected, the data operation request is forwarded to the database.
For example, when the proxy server is successfully connected with the database, the received data operation request of the client for the database may be forwarded to the successfully connected database. For example, the proxy server may attempt to establish a connection with the database upon receiving a data operation request from client a for the database. When the connection with the database is successful, the data operation request of the client A for the database can be forwarded to the database.
In step S13, first monitoring information associated with the database establishment connection is recorded,
wherein the first monitoring information comprises at least one of:
connection duration information for establishing connection with the database and first state information of the database.
For example, the proxy server may record first monitoring information associated with establishing a connection with a database (e.g., the proxy server may record connection duration information for establishing a connection with the database). For example, the proxy server may record a first time that a data operation request from the client to the database is received and a second time that the proxy server establishes a connection with the database. In this way, the difference between the second time and the first time can be used as the connection duration information for establishing the connection with the database. The proxy server may further record first state information of the database, where the first state information may include state information of the database during connection establishment between the proxy server and the database. For example, the first status information may include database connection success information, and the like.
In this way, the first monitoring information associated with the connection establishment of the database can be recorded by the proxy server, so that the fine monitoring (namely, fine-grained monitoring) of each operation link of the database can be realized, and the capability of establishing the connection of the database can be monitored. Those skilled in the art will appreciate that the proxy server may obtain various types of monitoring information (e.g., connection duration information, status information, etc.) associated with establishing a connection with the database, and the disclosure is not limited thereto.
FIG. 3 is a flow chart illustrating a database monitoring method according to an exemplary embodiment. In one possible implementation, as shown in fig. 3, the method further includes:
in step S14, when the connection to the database fails, recording second monitoring information associated with the connection to the database,
wherein the second monitoring information comprises second status information of the database.
For example, when a proxy server attempts to establish a connection with a database, a failure to connect the database may occur (e.g., a database connection timeout, a database connection exception, etc.). At this point, the proxy server may record second monitoring information associated with establishing a connection with the data block. For example, the second state information of the database is database connection timeout information, and the proxy server may record the database connection timeout information.
In this way, the second monitoring information associated with the connection establishment of the database can be recorded by the proxy server, so as to realize fine monitoring (namely fine-grained monitoring) in the connection process of the database and monitor the connection establishment capability of the database. Those skilled in the art will appreciate that the proxy server may obtain various types of monitoring information associated with establishing a connection with the database (e.g., status information of the database, etc.), which is not limited by the present disclosure.
FIG. 4 is a flow chart illustrating a database monitoring method according to an exemplary embodiment. In one possible implementation, as shown in fig. 4, the method further includes:
in step S15, when a response of the database to the data operation request is received, forwarding the response to the client;
in step S16, third monitoring information associated with the database return response is recorded,
wherein the third monitoring information comprises at least one of:
the operation duration information of the database and the third state information of the database.
For example, when the connection between the database and the proxy server is successfully established, the database may perform an operation (e.g., a read data operation or a write data operation) when receiving a data operation request forwarded by the proxy server, and return a response to the data operation request (e.g., data read by the read data operation) to the proxy server after the operation is completed. The proxy server may forward a response to the database for the data operation request to the client upon receiving the response. The proxy server may record third monitoring information associated with the database return response, wherein the third monitoring information may include at least one of:
the operation duration information of the database and the third state information of the database.
For example, as described above, the proxy server may record a second time when a connection is established with the database, and the proxy server may record a third time when a response to the data operation request is received from the database. Thus, the difference between the third time and the second time can be used as the operation duration information of the database. The proxy server may further record third state information of the database, where the third state information may include state information in an operation process after the database is connected to the proxy server, for example, information such as an operation state of the database.
By the method, the database can respond to the data operation request, fine-grained monitoring can be carried out in the operation process, and the capability of monitoring the data returned by the database can be realized. Those skilled in the art will appreciate that the proxy server may obtain various types of monitoring information (e.g., operational duration information, status information, etc.) associated with database return responses, and the disclosure is not limited thereto.
FIG. 5 is a flow chart illustrating a database monitoring method according to an exemplary embodiment. In one possible implementation, as shown in fig. 5, the method further includes:
in step S17, when the response of the database to the data operation request cannot be received, recording fourth monitoring information associated with the database return response,
wherein the fourth monitoring information includes fourth status information of the database.
For example, when the proxy server successfully establishes a connection with the database, a situation may occur that a response of the database to the data operation request cannot be received (for example, the database does not return data), and at this time, the proxy server may record fourth monitoring information associated with the database return response. For example, the fourth status information of the database is a data exception returned by the database, and the proxy server may record the data exception returned by the data block.
By the method, the database can respond to the data operation request, fine-grained monitoring can be carried out in the operation process, and the capability of monitoring the data returned by the database can be realized. Those skilled in the art will appreciate that the proxy server may obtain various types of monitoring information (e.g., operational duration information, status information, etc.) associated with database return responses, and the disclosure is not limited thereto.
FIG. 6 is a flow chart illustrating a database monitoring method according to an exemplary embodiment. In one possible implementation, as shown in fig. 6, the method further includes:
in step S18, according to the characteristics of the data operation request, determining a monitoring mode for the data operation request,
wherein, the step S13 may include:
in step S131, for the data operation request conforming to the monitoring mode, recording first monitoring information associated with establishing connection with the database,
wherein the characteristics of the data operation request include at least one of:
a type of the data operation request and a number of the data operation requests.
In one possible implementation, the proxy server may characterize the type of the data operation request and determine a monitoring mode for the data operation request. For example, the proxy server may determine a monitoring mode for the data operation request according to a type of the data operation request (e.g., a data type, etc.). For example, it may be set according to a requirement, and the proxy server may perform 100% monitoring on the data operation request of type a (monitoring mode is 100% monitoring), and perform 50% monitoring on the data operation request of type B (monitoring mode is 50% monitoring, for example, sampling monitoring on the data operation request of type B). At this time, when the proxy server receives the data operation request with the type of class a, because the monitoring mode of the data operation request with class a is 100% monitoring, first monitoring information associated with establishing connection with the database is recorded for the data operation request. When the data operation request with the type of B is received by the proxy server, first monitoring information associated with connection establishment of the database is recorded for the B-type data operation request conforming to a monitoring mode (50%). For example, the proxy server receives a data operation request of type B, the data operation request conforms to the monitoring mode (selected), and at this time, first monitoring information associated with connection establishment of the database is recorded. When the data operation request of the type B does not conform to the monitoring mode (is not selected), the proxy server does not record.
By the method, the flexibility and pertinence of monitoring the data operation request can be improved, and the data operation request which is mainly monitored can be adjusted at any time. Those skilled in the art will appreciate that the monitoring mode determined for the characteristics of the data operation request can be set as desired, and the present disclosure is not limited thereto.
In one possible implementation, the proxy server may also characterize the number of data operation requests and determine a monitoring mode for the data operation requests. For example, the proxy server may determine a monitoring mode for the data operation request according to the number of data operation requests. For example, when the number of data operation requests is small, the proxy server may determine that the monitoring mode for the data operation requests is 100% monitoring. At this time, the proxy server may monitor all data operation requests it receives. When the number of data operation requests received by the proxy server is large (e.g., the number is increased momentarily), the proxy server may re-determine the monitoring mode (e.g., 20% monitoring) for the data operation request according to the number of data operation requests. At this time, the proxy server monitors the part of the data operation request received by the proxy server.
In this way, the proxy server can adjust the monitoring mode (e.g., adjust the monitoring proportion) according to the number of data operation requests. Those skilled in the art will appreciate that the monitoring mode determined for the data operation request according to the number of the data operation requests may be set according to the requirement, which is not limited by the present disclosure.
Those skilled in the art will understand that, according to the characteristics of the data operation request, for example, the type of the data operation request may be used as the characteristic, the number of the data operation requests may be used as the characteristic, the type and the number of the data operation requests may also be used as the characteristic, and also according to other characteristics of the data operation request, the monitoring mode for the data operation request may be determined, and one or more of the first monitoring information, the second monitoring information, the third monitoring information, and the fourth monitoring information corresponding to the monitoring mode may be recorded according to the situation and the requirement, which is not limited by the present disclosure.
In one possible implementation, the proxy server may send one or more of the first monitoring information, the second monitoring information, the third monitoring information, and the fourth monitoring information to a data collection server,
the data collection server is configured to collect and display one or more of the first monitoring information, the second monitoring information, the third monitoring information, and the fourth monitoring information.
For example, the proxy server may record the first monitoring information and the third monitoring information (at this time, the proxy server establishes a connection with the database and receives a response of the database to the data operation request), and send the first monitoring information and the third monitoring information to the data collection server. The data collection server may collect the first monitoring information and the third monitoring information sent by the proxy server, and may perform presentation, for example, presentation in the form of a graph.
Therefore, an operator can know the relevant monitoring information of the database in time, monitor whether each operation link of the database is abnormal or not based on the relevant monitoring information, judge influence factors (for example, influence factors such as improper database cluster size, excessive database connection, insufficient bandwidth and the like), and process the influence factors (for example, adjusting the database cluster size, performing service optimization on a server and the like).
Application example
An application example according to the embodiment of the present disclosure is given below in conjunction with "monitoring database operations by a proxy server" as an exemplary application scenario to facilitate understanding of the flow of the database monitoring method. It should be understood by those skilled in the art that the following application examples are only for the purpose of facilitating understanding of the embodiments of the present invention, and should not be construed as limiting the embodiments of the present invention.
Fig. 7 is a schematic diagram illustrating an application scenario of a database monitoring method according to an exemplary embodiment. As shown in fig. 7, in this application example, a database cluster (including 1 master database and 4 slave databases) builds a set of proxy servers on the upper layer, and the proxy servers monitor database operations.
In this application example, a client operates on a database, initiating a data operation request (e.g., a read data request). In this application example, the proxy server receives a read data request from the client for the database and connects to the database.
In this application example, the master database is responsible for write data operations and the slave database is responsible for read data operations. In this application example, the proxy server may determine load conditions of a plurality of slave databases in the database cluster. According to the load conditions of a plurality of slave databases, the database to be connected is determined to be the slave database 3, and the slave database 3 is connected.
In this application example, the proxy server may forward the data operation request to the slave database 3 when the connection is successful from the database 3. In this application example, the proxy server may operate on the requested characteristics according to the data. For example, the proxy server may characterize the type of data operation request to determine a monitoring mode for the data operation request. For example, the type of the data operation request received by the proxy server is class a, the monitoring mode of the data operation request is 100% monitoring, and at this time, the proxy server records first monitoring information associated with establishing a connection from the database 3, for example, connection duration information of establishing a connection with the database, and the like. In this application example, if the type of the data operation request received by the proxy server is class B, the monitoring mode of the data operation request is 50% monitoring, and if the data operation request conforms to the data operation request in the monitoring mode, the data operation request may be monitored. For example, in the case where the proxy server cannot establish a connection with the slave database 3 and there is a database connection timeout, the second state information (connection timeout information) of the slave database 3 may be recorded as the second monitoring information associated with the establishment of a connection from the database 3.
In this application example, the proxy server may also characterize the number of data operation requests and determine a monitoring mode for the data operation requests. For example, when the number of received data operation requests is small (e.g., 1000 per second), the proxy server may determine that the monitoring mode for the data operation requests is 100% monitoring. At this time, all data operation requests are monitored. In this application example, when the number of data operation requests received by the proxy server increases (e.g., from 1000 to 10000 per second), the proxy server may determine that the monitoring mode for the data operation requests is 20%, and at this time, 2000 of the 10000 data operation requests per second are monitored. For example, for a data operation request conforming to the monitoring mode, corresponding monitoring information is recorded.
In this application example, after the proxy server establishes a connection with the slave database 3, the slave database 3 may operate in response to the data operation request and return data to the proxy server. The proxy server, upon receiving data requested for the data operation from the database 3, may forward the data to the client, and record third monitoring information (e.g., operation duration of the database, etc.) associated with the database return data.
In this application example, when the proxy server fails to receive a response to the data operation request from the database 3 after establishing a connection with the slave database 3 is successful (for example, an exception is responded from the database 3, or the like), at this time, the proxy server may record fourth monitoring information associated with returning a response from the database 3 (for example, exception information is responded from the database 3, or the like).
In this application example, the proxy server may send one or more of the first monitoring information, the second monitoring information, the third monitoring information, and the fourth monitoring information to the data collection server. The data collection server may display in the form of a graph after receiving the corresponding monitoring information.
According to the embodiment of the disclosure, when a data operation request of a client for a database is received by a proxy server, the proxy server is connected with the database, and when the connection is successful, the proxy server forwards the data operation request to the database, and records first monitoring information associated with the connection establishment of the database, so that fine-grained monitoring of the database is realized.
FIG. 8 is a block diagram illustrating a database monitoring apparatus according to an exemplary embodiment. Referring to fig. 8, the apparatus includes a connection module 81, a request forwarding module 82, and a first recording module 83.
The connection module 81 is configured to connect the database when receiving a data operation request of a client for the database;
the request forwarding module 82 is configured to forward the data operation request to the database when the database connection is successful;
the first recording module 83 is configured to record first monitoring information associated with establishing a connection with the database.
FIG. 9 is a block diagram illustrating a database monitoring apparatus according to an exemplary embodiment. Referring to fig. 9, in one possible implementation, the apparatus further includes:
a second recording module 84 configured to record second monitoring information associated with establishing a connection with the database upon failure to connect the database,
wherein the second monitoring information comprises second status information of the database.
Referring to fig. 9, in one possible implementation, the apparatus further includes:
a response forwarding module 85 configured to, upon receiving a response of the database to the data operation request, forward the response to the client;
a third recording module 86 configured to record third monitoring information associated with the database return response.
Referring to fig. 9, in one possible implementation, the apparatus further includes:
a fourth recording module 87 configured to record fourth monitoring information associated with the database return response when the response of the database to the data operation request cannot be received,
wherein the fourth monitoring information includes fourth status information of the database.
Referring to fig. 9, in one possible implementation, the apparatus further includes:
a determination module 88 configured to determine a monitoring mode for the data operation request based on a characteristic of the data operation request,
wherein the first recording module 83 includes:
a first recording sub-module 831 configured to record first monitoring information associated with establishing a connection with the database for a data operation request conforming to the monitoring mode,
wherein the characteristics of the data operation request include at least one of:
a type of the data operation request and a number of the data operation requests.
Referring to fig. 9, in one possible implementation, the connection module 81 includes:
a first determining submodule 811 configured to determine load states of the plurality of databases upon receiving a data operation request of the client for the databases;
a second determining submodule 812 configured to determine a database to be connected according to the load states of the plurality of databases;
a connection sub-module 813 configured to connect the databases to be connected.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 10 is a block diagram illustrating a database monitoring apparatus according to an exemplary embodiment. For example, the apparatus 1900 may be provided as a server. Referring to FIG. 10, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided that includes instructions, such as the memory 1932 that includes instructions, which are executable by the processing component 1922 of the apparatus 1900 to perform the above-described method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. A database monitoring method is applied to a proxy server and comprises the following steps:
when a data operation request of a client for a database is received, connecting the database;
determining a monitoring mode for the data operation request according to the characteristics of the data operation request, wherein the characteristics of the data operation request comprise the type of the data operation request and/or the number of the data operation requests;
when the database is successfully connected, forwarding the data operation request to the database;
recording first monitoring information associated with establishing a connection with the database for a data operation request conforming to the monitoring mode,
wherein the first monitoring information comprises at least one of:
connection duration information for establishing connection with the database and first state information of the database.
2. The method of claim 1, further comprising:
recording second monitoring information associated with establishing a connection with the database upon a failure to connect the database,
wherein the second monitoring information comprises second status information of the database.
3. The method of claim 1, further comprising:
when a response of the database to the data operation request is received, forwarding the response to the client;
recording third monitoring information associated with the database return response,
wherein the third monitoring information comprises at least one of:
the operation duration information of the database and the third state information of the database.
4. The method of claim 1, further comprising:
when the response of the database to the data operation request cannot be received, recording fourth monitoring information associated with the response returned by the database,
wherein the fourth monitoring information includes fourth status information of the database.
5. The method of claim 1, wherein connecting the database upon receiving a data operation request from a client for the database comprises:
when a data operation request of a client for a database is received, determining load states of a plurality of databases;
determining databases to be connected according to the load states of the databases;
and connecting the databases to be connected.
6. A database monitoring apparatus, comprising:
the connection module is used for connecting the database when receiving a data operation request of a client aiming at the database;
the determining module is used for determining a monitoring mode aiming at the data operation request according to the characteristics of the data operation request, wherein the characteristics of the data operation request comprise the type of the data operation request and/or the number of the data operation requests;
the request forwarding module is used for forwarding the data operation request to the database when the database is successfully connected;
a first recording module for recording first monitoring information associated with establishing connection with the database aiming at the data operation request conforming to the monitoring mode,
wherein the first monitoring information comprises at least one of:
connection duration information for establishing connection with the database and first state information of the database.
7. The apparatus of claim 6, further comprising:
a second recording module for recording second monitoring information associated with the establishment of the connection with the database when the connection with the database fails,
wherein the second monitoring information comprises second status information of the database.
8. The apparatus of claim 6, further comprising:
the response forwarding module is used for forwarding a response of the database to the data operation request to the client when the response is received;
a third recording module for recording third monitoring information associated with the database return response,
wherein the third monitoring information comprises at least one of:
the operation duration information of the database and the third state information of the database.
9. The apparatus of claim 6, further comprising:
a fourth recording module, configured to record fourth monitoring information associated with a response returned by the database when a response to the data operation request by the database cannot be received,
wherein the fourth monitoring information includes fourth status information of the database.
10. The apparatus of claim 6, wherein the connection module comprises:
the first determining submodule is used for determining the load states of the plurality of databases when a data operation request of a client for the databases is received;
the second determining submodule is used for determining the databases to be connected according to the load states of the databases;
and the connecting submodule is used for connecting the databases to be connected.
11. A database monitoring apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to: performing the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor, enable the processor to perform the method of any one of claims 1-5.
CN201710779639.8A 2017-09-01 2017-09-01 Database monitoring method and device Active CN107632919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710779639.8A CN107632919B (en) 2017-09-01 2017-09-01 Database monitoring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710779639.8A CN107632919B (en) 2017-09-01 2017-09-01 Database monitoring method and device

Publications (2)

Publication Number Publication Date
CN107632919A CN107632919A (en) 2018-01-26
CN107632919B true CN107632919B (en) 2020-10-09

Family

ID=61100335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710779639.8A Active CN107632919B (en) 2017-09-01 2017-09-01 Database monitoring method and device

Country Status (1)

Country Link
CN (1) CN107632919B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542874A (en) * 2018-11-15 2019-03-29 用友网络科技股份有限公司 Deriving method, guiding device, server, terminal and readable storage medium storing program for executing

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980307A (en) * 2015-06-29 2015-10-14 小米科技有限责任公司 Processing method of data access requests, processing device of data access requests and database server
CN105868233A (en) * 2015-12-03 2016-08-17 乐视网信息技术(北京)股份有限公司 Data access processing method, device and system
CN106649856A (en) * 2016-12-30 2017-05-10 金蝶软件(中国)有限公司 Database access device, system and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8046675B2 (en) * 2007-12-28 2011-10-25 Yahoo! Inc. Method of creating graph structure from time-series of attention data
US20150264296A1 (en) * 2014-03-12 2015-09-17 videoNEXT Federal, Inc. System and method for selection and viewing of processed video

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104980307A (en) * 2015-06-29 2015-10-14 小米科技有限责任公司 Processing method of data access requests, processing device of data access requests and database server
CN105868233A (en) * 2015-12-03 2016-08-17 乐视网信息技术(北京)股份有限公司 Data access processing method, device and system
CN106649856A (en) * 2016-12-30 2017-05-10 金蝶软件(中国)有限公司 Database access device, system and method

Also Published As

Publication number Publication date
CN107632919A (en) 2018-01-26

Similar Documents

Publication Publication Date Title
CN110049087B (en) Credibility verification method, system, device and equipment of alliance chain
US20210036907A1 (en) Methods and apparatuses for pushing a message
US8447757B1 (en) Latency reduction techniques for partitioned processing
EP3489825A1 (en) Method, apparatus and computer readable storage medium for processing service
CN106933548B (en) Global information obtaining, processing and updating method, device and system
US20130054635A1 (en) Procuring communication session records
CN110471749B (en) Task processing method, device, computer readable storage medium and computer equipment
MX2013011250A (en) Providing a witness service.
US10802896B2 (en) Rest gateway for messaging
CN114338769B (en) Access request processing method and device
CN107632919B (en) Database monitoring method and device
CN113301155B (en) Data routing method, device, equipment and storage medium
EP3672203A1 (en) Distribution method for distributed data computing, device, server and storage medium
CN116097691A (en) Service request handling
CN110740464A (en) NF service discovery method and device
CN110581784B (en) Node health check method, device and equipment
CN114756530B (en) Client information processing method based on bastion machine
CN105871972A (en) Video resource distributed cathe method, device and system
CN106899652B (en) Method and device for pushing service processing result
US10389513B2 (en) Dynamic adjustment of wait time values
CN104509071B (en) processing request
US20200371881A1 (en) Data reading method of data source system having duplicate data sources
EP3691223A1 (en) Communication device and communication method used in distributed network
CN110971669B (en) Message notification method, device, server, electronic equipment and readable storage medium
CN115687168B (en) File operation notification system and method

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
GR01 Patent grant
GR01 Patent grant