CN114817212A - Database optimization method and optimization device - Google Patents

Database optimization method and optimization device Download PDF

Info

Publication number
CN114817212A
CN114817212A CN202210557428.0A CN202210557428A CN114817212A CN 114817212 A CN114817212 A CN 114817212A CN 202210557428 A CN202210557428 A CN 202210557428A CN 114817212 A CN114817212 A CN 114817212A
Authority
CN
China
Prior art keywords
database
data
data operation
parameters
link
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
CN202210557428.0A
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.)
East China Normal University
Beijing Oceanbase Technology Co Ltd
Original Assignee
East China Normal University
Beijing Oceanbase Technology 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 East China Normal University, Beijing Oceanbase Technology Co Ltd filed Critical East China Normal University
Priority to CN202210557428.0A priority Critical patent/CN114817212A/en
Publication of CN114817212A publication Critical patent/CN114817212A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/217Database tuning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The specification discloses an optimization method and an optimization device for a database, if an appointed functional area of the database is monitored to be in an abnormal state, database parameters corresponding to the appointed functional area can be adjusted to obtain adjusted parameters, the database is optimized according to the adjusted parameters, if the monitored global performance of the database does not meet preset conditions, at least one database parameter of each data operation link can be adjusted according to each data operation link related to data corresponding to the database to obtain adjusted parameters, and the database is optimized according to the adjusted parameters.

Description

Database optimization method and optimization device
Technical Field
The present disclosure relates to the field of databases, and in particular, to a method and an apparatus for optimizing a database.
Background
In practical application, the database contains a large number of database parameters, and reasonable configuration and adjustment of the database parameters are necessary bases for maintaining one database.
Currently, when a database has a problem, a database administrator may manually adjust the database parameters, but it is difficult to reasonably adjust all the database parameters by manually adjusting the database parameters.
Therefore, how to reasonably adjust the database parameters to maintain the normal operation of the database is an urgent problem to be solved.
Disclosure of Invention
The present specification provides an optimization method and an optimization device for a database, so as to adjust parameters of the database and ensure good operation of the database.
The technical scheme adopted by the specification is as follows:
the present specification provides a database optimization method, including:
if the specified function area of the database is monitored to be in an abnormal state, database parameters corresponding to the specified function area are adjusted to obtain adjusted parameters, and the database is optimized according to the adjusted parameters;
if the monitored global performance of the database does not meet the preset condition, adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter, and optimizing the database according to the adjusted parameter.
Optionally, if it is monitored that the designated functional area of the database is in an abnormal state, adjusting the database parameter corresponding to the designated functional area, specifically including:
and if the designated function area is the data buffer area of the database, increasing the capacity value of the data buffer area.
Optionally, if it is monitored that the designated functional area of the database is in an abnormal state, adjusting the database parameter corresponding to the designated functional area, specifically including:
and if the designated functional area is the log buffer area of the database, increasing the capacity value of the log buffer area.
Optionally, adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter, specifically including:
adjusting at least one database parameter of each data operation link according to the sequence of each data operation link when operating on the corresponding data of the database to obtain an adjusted parameter, wherein each data operation link comprises: a CPU calling link, a lock ring link, a memory link and a disk link.
Optionally, adjusting at least one database parameter of each data operation link according to the sequence of each data operation link related to the data corresponding to the database to obtain an adjusted parameter, specifically including:
sequencing the data operation links according to the reverse sequence of writing the data into the database to obtain a sequencing result;
and after adjusting database parameters corresponding to the Nth data operation link in the sequencing result, monitoring the global performance of the database, and if the monitored global performance of the database still does not meet the preset condition, adjusting the database parameters corresponding to the (N + 1) th data operation link in the sequencing result, wherein N is a positive integer.
Optionally, adjusting at least one database parameter of each data operation link according to each data operation link related to the data corresponding to the database specifically includes:
determining a bottleneck type of a system bottleneck existing in the database according to the system state data of the database, and taking a data operation link corresponding to the bottleneck type as a target link;
and adjusting the database parameters of the target link.
Optionally, the method further comprises:
and after the database parameters of the target link are adjusted, if the global performance of the database is monitored to still not meet the preset condition, adjusting the database parameters corresponding to other data operation links except the target link.
Optionally, the method further comprises:
if the database is optimized according to the adjusted parameters, and the overall performance of the database is monitored to still not meet the preset conditions, the current system state data of the database is input into a preset parameter optimization model to obtain the adjusted parameters, and the database is optimized.
The present specification provides an optimization apparatus for a database, including:
the first adjusting module is used for adjusting database parameters corresponding to the designated functional area to obtain adjusted parameters if the designated functional area of the database is monitored to be in an abnormal state, and optimizing the database according to the adjusted parameters;
and the second adjusting module is used for adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter if the monitored global performance of the database does not meet the preset condition, and optimizing the database according to the adjusted parameter.
Optionally, the first adjusting module is specifically configured to increase a capacity value of the data buffer area if the designated function area is the data buffer area of the database.
Optionally, the first adjusting module is specifically configured to increase a capacity value of the log buffer if the designated functional area is the log buffer of the database.
Optionally, the second adjusting module is specifically configured to adjust at least one database parameter of each data operation link according to an order of the data operation links when operating on the data corresponding to the database, to obtain an adjusted parameter, where each data operation link includes: a CPU calling link, a lock ring link, a memory link and a disk link.
Optionally, the second adjusting module is specifically configured to sort the data operation links according to an opposite order of writing the data into the database, so as to obtain a sorting result; and after adjusting database parameters corresponding to the Nth data operation link in the sequencing result, monitoring the global performance of the database, and if the monitored global performance of the database still does not meet the preset condition, adjusting the database parameters corresponding to the (N + 1) th data operation link in the sequencing result, wherein N is a positive integer.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described database optimization method.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of optimizing the database when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
it can be seen from the above optimization method of the database that if it is monitored that the designated functional area of the database is in an abnormal state, the database parameters corresponding to the designated functional area can be adjusted to obtain adjusted parameters, and the database is optimized according to the adjusted parameters, and if it is monitored that the global performance of the database does not meet the preset conditions, at least one database parameter of each data operation link can be adjusted according to each data operation link related to the data corresponding to the database to obtain adjusted parameters, and the database is optimized according to the adjusted parameters.
As can be seen from the above, the optimization method for the database provided in this specification may adjust the database parameters in multiple ways when a certain problem occurs in the database, and may adjust the database parameters related to the designated functional area by monitoring whether the designated functional area of the database is abnormal or not, and may adjust the database parameters of the data operation link related to the database by monitoring whether the global performance of the database is better or not, thereby ensuring the operation safety of the database to a certain extent.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a schematic flow chart of a database optimization method in the present specification;
FIG. 2 is a schematic diagram of an overall process for adjusting database parameters provided in the present specification;
FIG. 3 is a schematic diagram of a detailed manner of adjusting database parameters by rules provided in this specification;
FIG. 4 is a schematic diagram of an optimization apparatus for a database provided herein;
fig. 5 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a database optimization method in this specification, which specifically includes the following steps:
s100: database parameters are initialized.
At present, digitalization has penetrated into various industries, and accordingly, databases can also be applied to various industries, thereby facilitating data storage, search and modification of various manufacturers and business parties.
When the database is constructed and starts to be applied, various parameters of the database need to be initialized, and particularly, the initialization mode can be configured manually or according to server resources of the database, but since the actual conditions of the database are different, the parameters may need to be changed to some extent according to the actual conditions, so that the parameters of the database can be automatically adjusted in order to ensure the good operation of the database.
Based on this, several ways of adjusting the parameters in the database will be described below.
S102: if the specified functional area of the database is monitored to be in an abnormal state, database parameters corresponding to the specified functional area are adjusted to obtain adjusted parameters, and the database is optimized according to the adjusted parameters.
If the server monitors that the designated functional area of the database is in an abnormal state, the server can adjust the database parameters corresponding to the designated functional area to obtain adjusted parameters, and optimize the database according to the adjusted parameters.
The monitoring that the designated function area of the database is in the abnormal state may refer to that the server directly monitors that some part of the database has a problem, for example, an index signal that some part of the database has a problem is directly given in a system log of the database, such as "Innodb _ buffer _ pool _ wait _ free" (indicating that a data buffer (buffer pool) of the database is congested), "Innodb _ log _ waits" (indicating that a log buffer (log buffer pool) of the database is congested) and the like. The designated functional area referred to herein may refer to a functional area in the database at the software level for assisting the database in performing database transactions.
When the above problem is detected, the database parameter related to the specified functional area in which the problem occurs may be directly adjusted, for example, if the specified functional area is a data buffer area of the database (when an internal index of the database, that is, "inbb _ buffer _ pool _ wait _ free", is detected, it indicates that the data buffer area has a problem), the capacity value of the data buffer area may be increased, and of course, other database parameters related to the data buffer area may also be modified. For example, the number of data buffers is increased, etc.
If the designated functional area is a log buffer area of the database (if an internal index of the database, i.e., "innodb _ log _ waits", is detected, it indicates that a problem occurs in the log buffer area), the capacity value of the log buffer area may be increased, and of course, other database parameters related to the log buffer area may also be modified, for example, the number parameter of the log buffer area is increased.
S104: if the monitored global performance of the database does not meet the preset condition, adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter, and optimizing the database according to the adjusted parameter.
If the monitored global performance of the database does not meet the preset condition, at least one database parameter of each data operation link can be adjusted according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter, and the database is optimized according to the adjusted parameter.
That is to say, the method does not clearly determine where the database is specifically problematic, and only determines that the global performance of the database does not meet the preset condition, the database parameters of each data operation link can be adjusted through each data operation link related to the database, and various methods can exist for specifically adjusting the database parameters of each data operation link.
Mode 1: the server may adjust at least one database parameter of each data operation link according to an order of each data operation link when operating on data corresponding to the database, to obtain an adjusted parameter, and each data operation link may include: a CPU calling link, a lock ring link, a memory link and a disk link. That is, the server may adjust the database parameters of each data operation link according to a certain sequence of each data operation link.
The database parameters may be adjusted according to the sequence of the data operation links, or there may be multiple ways, for example, the database parameters of the data operation links may be adjusted according to the reverse sequence of writing data into the database.
Specifically, the data operation links may be sorted according to a reverse order of writing data into the database to obtain a sorting result, the database parameter corresponding to the nth data operation link in the sorting result is adjusted, and the global performance of the database is monitored, and if it is determined that the global performance of the database still does not satisfy the preset condition, the database parameter corresponding to the (N + 1) th writing link in the sorting result may be adjusted, where N is a positive integer.
That is, the database parameters of each data operation link may be adjusted in turn in the reverse order of writing data into the database, for example, the order of writing data into the database is: the method comprises the steps that a CPU calls a link- > a lock ring link- > a memory link- > a disk link, when database parameters are adjusted, database parameters related to the disk link can be adjusted firstly, whether the overall performance of the database is good or not is monitored, the preset condition is met, if the overall performance of the database is met, the adjustment of the parameters can be stopped, if the overall performance of the database is not met, the adjustment of the database parameters of the next link can be continued, namely the database parameters related to the memory link, and so on, if the database parameters need to be adjusted continuously, the database parameters related to the lock link can be adjusted, and then the database parameters of the CPU calls the link.
The advantages of adjusting the database parameters in the above manner are: the data writing sequence of the database firstly passes through the CPU, then is locked, and then is written into the disk through the memory. If the configuration of parameters downstream in the above sequence causes a bottleneck, adjusting the upstream parameters in any way does not result in performance improvement and a large amount of tuning time is wasted.
Of course, the database parameters may be adjusted in other orders, for example, the database parameters of each data operation link may be adjusted according to the order of reading data from the database.
It should be noted that the database parameter of each data operation link is closely associated with the data operation link, for example, the database parameter of the CPU call link is a database parameter for controlling how the CPU calls and allocates, such as a parameter for controlling the number of read/write threads, and a parameter for controlling how many threads can simultaneously enter the database kernel. The database parameters of the lock link may be parameters specially used for processing the parameters related to the database lock resources (parameters for reducing lock conflicts), such as a parameter for setting the number of data buffers, and increasing the number of data buffers may reduce competition of the lock resources, and may also include the number of hash indexes.
The memory parameter may refer to a relevant parameter for controlling the memory size of the database, such as a parameter for controlling the capacity of the buffer, and a parameter for controlling the capacity of the log buffer. The disk parameters may refer to relevant parameters for controlling various file sizes of the database, such as a parameter for setting the file size of a redo log and a parameter for setting the size of an undo log.
In addition, the adjustment strategy of the database parameters for each data operation link can also be preset. For example, for some database parameters, the adjustment policy is mainly increased, for example, when adjusting parameters for setting the size of a redo log file and parameters for setting the size of an undo log, the parameters are mainly increased, when adjusting such database parameters, the parameters may be increased according to an increment value set for the parameters that need to be adjusted, and for some database parameters, the parameters may not be directly increased or decreased when adjusting, at this time, the parameters may be adjusted according to a parameter value range preset for the parameters in one direction (e.g., decreased or increased), if the global performance of the database is monitored to be increased, the adjustment may be continued until the global performance of the database meets a preset condition, and if the global performance of the database is monitored not to be increased, the parameters may be adjusted in another direction, in the same way, if the global performance of the database is monitored to be improved, the adjustment can be continued until the global performance of the database meets the preset condition, and specifically, adjustment strategies of different database parameters can be configured in advance.
It should be noted that, in the above manner, the database parameters of each data operation link are mainly adjusted according to a certain sequence, and in practical application, the bottleneck category of the system bottleneck existing in the database may be determined according to the system state data of the database, and the data operation link corresponding to the bottleneck category is used as the target link, so as to adjust the database parameters of the target link (manner 2). The system status data mentioned here can be used to represent the operation status of the database, and the system status data may specifically exist in various forms, such as average IO waiting time, CPU operation load, number of sectors read per second, number of sectors written per second, and the like.
Specifically, system state data of the database can be acquired through tools such as sar, iostat, vmstat and the like, and the bottleneck type of a system bottleneck existing in the database is determined according to the system state data, where the system bottleneck mentioned here can be a part of the database which is judged to be possibly in which a problem (bottleneck) occurs, and is a CPU, a lock, a memory or a disk. Therefore, the bottleneck category is related to each data operation link, that is, the bottleneck category may include: the CPU calls the bottleneck, the bottleneck lock, the memory bottleneck and the disk bottleneck, and further, after the bottleneck category of the database is determined, a data operation link corresponding to the bottleneck category can be determined, and database parameters related to the data operation link are adjusted.
After the database parameters of the target link are adjusted, if the monitored global performance of the database still does not meet the preset conditions, the database parameters corresponding to other data operation links except the target link can be adjusted according to the sequence of the data operation links related to the data corresponding to the database. Specifically, when database parameters corresponding to other data operation links are adjusted, the database parameters of each other data operation link can be adjusted in the mode 1.
That is, database parameters of other data operation links may be adjusted according to an order of the data operation links when operating data corresponding to the database, for example, the other data operation links may be sorted according to an opposite order of writing data into the database to obtain a sorting result, database parameters of other data operation links are sequentially adjusted, after adjusting database parameters corresponding to an nth other data operation link in the sorting result, the global performance of the database is monitored, and if it is monitored that the global performance of the database still does not meet a preset condition, database parameters corresponding to an N +1 th other data operation link in the sorting result are adjusted, where N is a positive integer.
It should be noted that the preset condition mentioned above may be preset, for example, the global performance may include throughput, delay, and the like of the database, and the preset condition may be that the throughput of the database needs to be greater than the preset throughput, and/or the delay of the database needs to be less than the preset delay.
It is worth mentioning that, if the database parameters are adjusted in the above manner, and the global performance of the database still does not meet the preset condition after the database is optimized according to the adjusted parameters, the current system state data of the database may be input into the preset parameter optimization model to obtain the adjusted parameters, and the database is optimized.
That is, if the database is optimized in the above manner, a better effect is not achieved, the database parameters may be searched through a machine learning model (i.e., the parameter optimization model mentioned here), so as to obtain adjusted parameters, and besides the system state data of the database, the target performance values that the database is expected to reach may be input into the parameter optimization model, so that the adjusted parameters output by the parameter optimization model may enable the database to reach the target performance corresponding to the target performance values as much as possible.
The bottleneck type of the system bottleneck of the database can be determined according to the system state data of the database, and then the database parameters of the data operation link corresponding to the bottleneck type can be adjusted according to the parameter optimization model.
Specifically, the method comprises the following steps. The parameter optimization models may be multiple, each bottleneck category corresponds to one parameter optimization model, when adjusting the database parameters of one bottleneck category, the adjusted parameters may be obtained according to the parameter optimization model corresponding to the bottleneck category, of course, only one parameter optimization model may be present, and when adjusting the database parameters of one bottleneck category, the parameter optimization model only determines the adjusted parameters corresponding to the bottleneck category.
The form of the parameter optimization model can be various, for example, the parameter optimization model can be a gaussian process model, and can also be a reinforcement learning model.
The method for optimizing the database in the present specification will be described in the form of a complete example, as shown in fig. 2 and 3.
Fig. 2 is a schematic diagram of an overall process for adjusting database parameters provided in this specification.
Fig. 3 is a schematic diagram of a detailed manner of adjusting database parameters by rules provided in this specification.
As can be seen from fig. 2, the database parameters may be initialized first, and then through certain rules, the database parameters are adjusted, and finally, the database parameters can be adjusted through a parameter optimization model, when the database parameters are adjusted, as can be seen from fig. 3, when the database parameters are adjusted by a certain rule, the database parameters of the designated functional area can be adjusted by monitoring whether the designated functional area of the database is in an abnormal state, that is, it may be determined whether a specified functional area of the database is abnormal by some specific status indicator generated by the database, and then adjust the corresponding parameter, can also be through monitoring whether the overall situation of the database accords with the way of the predetermined condition, adjust the database parameter of the link of the magnetic disc, memory link, lock ring section and CPU call link sequentially.
The method can adjust the database parameters when a certain problem occurs in the database in various ways, not only can adjust the database parameters related to the designated functional area by monitoring whether the designated functional area of the database is abnormal or not, but also can adjust the database parameters related to the data operation link corresponding to the system bottleneck which can cause the global performance of the database to not reach the preset condition or can tentatively adjust the database parameters related to the data operation link in sequence according to a certain sequence of the data operation links, thereby ensuring the operation safety of the database to a certain extent.
Based on the same idea, the present specification further provides an optimization apparatus for a database, as shown in fig. 4.
Fig. 4 is a schematic diagram of an optimization apparatus for a database provided in this specification, which specifically includes:
a first adjusting module 401, configured to adjust a database parameter corresponding to an assigned functional area of a database to obtain an adjusted parameter if the assigned functional area of the database is monitored to be in an abnormal state, and optimize the database according to the adjusted parameter;
a second adjusting module 402, configured to, if it is monitored that the global performance of the database does not meet a preset condition, adjust at least one database parameter of each data operation link according to each data operation link related to data corresponding to the database to obtain an adjusted parameter, and optimize the database according to the adjusted parameter.
Optionally, the first adjusting module 401 is specifically configured to, if the designated functional area is a data buffer area of the database, increase a capacity value of the data buffer area.
Optionally, the first adjusting module 401 is specifically configured to, if the designated functional area is a log buffer area of the database, increase a capacity value of the log buffer area.
Optionally, the second adjusting module 402 is specifically configured to adjust at least one database parameter of each data operation link according to a sequence of each data operation link when operating on data corresponding to the database, to obtain an adjusted parameter, where each data operation link includes: a CPU calling link, a lock ring link, a memory link and a disk link.
Optionally, the second adjusting module 402 is specifically configured to sort the data operation links according to an opposite order of writing data into the database, so as to obtain a sorting result; and after adjusting database parameters corresponding to the Nth data operation link in the sequencing result, monitoring the global performance of the database, and if the monitored global performance of the database still does not meet the preset condition, adjusting the database parameters corresponding to the (N + 1) th data operation link in the sequencing result, wherein N is a positive integer.
Optionally, the second adjusting module 402 is specifically configured to determine, according to the system state data of the database, a bottleneck category of a system bottleneck existing in the database, and use a data operation link corresponding to the bottleneck category as a target link; and adjusting the database parameters of the target link.
Optionally, the second adjusting module 402 is further configured to, if it is monitored that the database parameters of the target link are adjusted and the global performance of the database still does not meet the preset condition, adjust the database parameters corresponding to other data operation links except the target link.
Optionally, the apparatus further comprises:
and a model optimization module 403, configured to, if the database is optimized according to the adjusted parameter, monitor that the global performance of the database still does not meet a preset condition, input the current system state data of the database into a preset parameter optimization model to obtain an adjusted parameter, and optimize the database.
The present specification also provides a computer-readable storage medium storing a computer program, which can be used to execute the above-mentioned database optimization method.
This specification also provides a schematic block diagram of the electronic device shown in fig. 5. As shown in fig. 5, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required by other services. The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to realize the database optimization method. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: the ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (15)

1. A method of database optimization, comprising:
if the specified function area of the database is monitored to be in an abnormal state, database parameters corresponding to the specified function area are adjusted to obtain adjusted parameters, and the database is optimized according to the adjusted parameters;
if the monitored global performance of the database does not meet the preset condition, adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter, and optimizing the database according to the adjusted parameter.
2. The method according to claim 1, wherein if it is monitored that a designated functional area of the database is in an abnormal state, the method adjusts database parameters corresponding to the designated functional area, and specifically comprises:
and if the designated function area is the data buffer area of the database, increasing the capacity value of the data buffer area.
3. The method according to claim 1, wherein if it is monitored that a designated functional area of the database is in an abnormal state, the method adjusts database parameters corresponding to the designated functional area, and specifically comprises:
and if the designated functional area is the log buffer area of the database, increasing the capacity value of the log buffer area.
4. The method according to claim 1, wherein the adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter specifically comprises:
adjusting at least one database parameter of each data operation link according to the sequence of each data operation link when operating on the corresponding data of the database to obtain an adjusted parameter, wherein each data operation link comprises: a CPU calling link, a lock ring link, a memory link and a disk link.
5. The method according to claim 4, wherein the step of adjusting at least one database parameter of each data operation link according to the sequence of each data operation link related to the corresponding data in the database to obtain an adjusted parameter specifically comprises:
sequencing the data operation links according to the reverse sequence of writing the data into the database to obtain a sequencing result;
and after adjusting database parameters corresponding to the Nth data operation link in the sequencing result, monitoring the global performance of the database, and if the monitored global performance of the database still does not meet the preset condition, adjusting the database parameters corresponding to the (N + 1) th data operation link in the sequencing result, wherein N is a positive integer.
6. The method according to claim 1, wherein the adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database specifically comprises:
determining a bottleneck type of a system bottleneck existing in the database according to the system state data of the database, and taking a data operation link corresponding to the bottleneck type as a target link;
and adjusting the database parameters of the target link.
7. The method of claim 6, further comprising:
and if the global performance of the database still does not meet the preset condition after the database parameters of the target link are monitored to be adjusted, adjusting the database parameters corresponding to other data operation links except the target link.
8. The method of claim 1, further comprising:
if the database is optimized according to the adjusted parameters, and the overall performance of the database is monitored to still not meet the preset conditions, the current system state data of the database is input into a preset parameter optimization model to obtain the adjusted parameters, and the database is optimized.
9. An apparatus for database optimization, comprising:
the first adjusting module is used for adjusting database parameters corresponding to the designated functional area to obtain adjusted parameters if the designated functional area of the database is monitored to be in an abnormal state, and optimizing the database according to the adjusted parameters;
and the second adjusting module is used for adjusting at least one database parameter of each data operation link according to each data operation link related to the corresponding data of the database to obtain an adjusted parameter if the monitored global performance of the database does not meet the preset condition, and optimizing the database according to the adjusted parameter.
10. The apparatus of claim 9, wherein the first adjusting module is specifically configured to increase a capacity value of the data buffer if the designated functional area is a data buffer of the database.
11. The apparatus of claim 9, wherein the first adjusting module is specifically configured to increase a capacity value of the log buffer if the designated functional area is the log buffer of the database.
12. The apparatus of claim 9, wherein the second adjusting module is specifically configured to adjust at least one database parameter of each data operation link according to an order of the data operation links when operating on the data corresponding to the database, so as to obtain an adjusted parameter, and each data operation link includes: a CPU calling link, a lock ring link, a memory link and a disk link.
13. The apparatus according to claim 12, wherein the second adjustment module is specifically configured to sort the data operation links in a reverse order of writing data into the database to obtain a sorting result; and after adjusting database parameters corresponding to the Nth data operation link in the sequencing result, monitoring the global performance of the database, and if the monitored global performance of the database still does not meet the preset condition, adjusting the database parameters corresponding to the (N + 1) th data operation link in the sequencing result, wherein N is a positive integer.
14. A computer-readable storage medium, storing a computer program which, when executed by a processor, implements the method of any of claims 1 to 8.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of claims 1 to 8 when executing the program.
CN202210557428.0A 2022-05-20 2022-05-20 Database optimization method and optimization device Pending CN114817212A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210557428.0A CN114817212A (en) 2022-05-20 2022-05-20 Database optimization method and optimization device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210557428.0A CN114817212A (en) 2022-05-20 2022-05-20 Database optimization method and optimization device

Publications (1)

Publication Number Publication Date
CN114817212A true CN114817212A (en) 2022-07-29

Family

ID=82517787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210557428.0A Pending CN114817212A (en) 2022-05-20 2022-05-20 Database optimization method and optimization device

Country Status (1)

Country Link
CN (1) CN114817212A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116594981A (en) * 2023-05-18 2023-08-15 合芯科技(苏州)有限公司 Database system parameter optimization method and device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116594981A (en) * 2023-05-18 2023-08-15 合芯科技(苏州)有限公司 Database system parameter optimization method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN108845936B (en) AB testing method and system based on massive users
CN107450979B (en) Block chain consensus method and device
CN107577694B (en) Data processing method and device based on block chain
CN110389842B (en) Dynamic resource allocation method, device, storage medium and equipment
CN108459913B (en) Data parallel processing method and device and server
JP2024529206A (en) Distributed Training for Container Scheduling for Intelligent Computing
CN109376189A (en) Processing method, device and the equipment of batch data operation
CN112596898A (en) Task executor scheduling method and device
CN113992525A (en) Method and device for adjusting number of applied containers
JP2024536659A (en) Task execution method, apparatus, storage medium and electronic device
CN114817212A (en) Database optimization method and optimization device
CN115618748A (en) Model optimization method, device, equipment and storage medium
CN114840427A (en) Code testing and test case generating method and device
CN113032119A (en) Task scheduling method and device, storage medium and electronic equipment
CN107368281B (en) Data processing method and device
CN115878654A (en) Data query method, device, equipment and storage medium
CN108681554B (en) Matching method, device and equipment using regular expression
CN108470242B (en) Risk management and control method, device and server
CN116185617A (en) Task processing method and device
CN115904785A (en) Abnormity positioning method, device, equipment and readable storage medium
CN114333102A (en) Parameter configuration method and configuration device of unmanned equipment
CN109614388B (en) Budget deduction method and device
CN114398178A (en) Task execution method and device and electronic equipment
CN110032563B (en) Processing method and system of mismatch value and electronic equipment
CN114676132A (en) Data table association method and device, storage medium and electronic equipment

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