CN115982130A - Database performance optimization method, storage medium and computer device - Google Patents

Database performance optimization method, storage medium and computer device Download PDF

Info

Publication number
CN115982130A
CN115982130A CN202310015941.1A CN202310015941A CN115982130A CN 115982130 A CN115982130 A CN 115982130A CN 202310015941 A CN202310015941 A CN 202310015941A CN 115982130 A CN115982130 A CN 115982130A
Authority
CN
China
Prior art keywords
database
cpu
kernel
service process
computer
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
CN202310015941.1A
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.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information Technologies 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 Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202310015941.1A priority Critical patent/CN115982130A/en
Publication of CN115982130A publication Critical patent/CN115982130A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a database performance optimization method, a storage medium and computer equipment. Wherein the method comprises the following steps: acquiring a database service process to be optimized; acquiring running information of each CPU core of a computer of a database management system; selecting a CPU kernel as a process processing kernel according to the running information; binding the database service process to be optimized to a process processing kernel so as to process the database service process to be optimized by the process processing kernel. Therefore, the database service process is bound to a specific CPU kernel, so that the CPU resource of the current computer can be more effectively used when the database runs, and the execution efficiency and performance of the database are improved.

Description

Database performance optimization method, storage medium and computer device
Technical Field
The present invention relates to database technologies, and in particular, to a method for optimizing performance of a database, a storage medium, and a computer device.
Background
The database needs to run in the server, and the server CPU is relied on to run the database service process, and nowadays, the server CPU generally has a plurality of kernels. The running mechanism of the service process after the database is started is scheduled by the operating system, and in a multi-core scene of a server CPU, when a plurality of service processes are run, the problem of performance reduction of the server caused by frequent scheduling of the operating system may occur.
Disclosure of Invention
One purpose of the invention is that the database realizes intelligent binding of the database service process and the CPU kernel.
It is a further object of this invention to enable database runtime to more efficiently use the CPU resources of current computers.
It is a further object of this invention to improve the ease of use of databases.
In particular, the present invention provides a method for optimizing the performance of a database, comprising:
acquiring a database service process to be optimized;
acquiring running information of each CPU (Central processing Unit) kernel of a computer of a database management system;
selecting a CPU kernel as a process processing kernel according to the running information;
and binding the database service process to be optimized to the process processing kernel so as to process the database service process to be optimized by the process processing kernel.
Optionally, the step of obtaining the operation information of each CPU core of the computer of the database management system includes: acquiring the utilization rate of each CPU kernel and the binding condition of a service process;
the step of selecting a CPU inner core as a process processing inner core according to the operation information comprises the following steps: determining a CPU kernel which is not bound with a service process according to the binding condition of the service process; and sequencing the utilization rates of the CPU kernels not bound with the service processes, and taking the lowest utilization rate as the process processing kernel.
Optionally, the step of determining, according to the service process binding condition, that the CPU core of the service process is not bound yet further includes:
and if the CPU inner cores which are not bound with the service processes do not exist, sequencing the utilization rates of the CPU inner cores which are bound with the service processes, and taking the lowest utilization rate as a process processing inner core.
Optionally, the step of obtaining the usage rate of each CPU core includes:
sampling the utilization rate of each CPU core according to a set sampling period to obtain a utilization rate sampling value;
and calculating the average value of the sampling values according to a set period to serve as the utilization rate of the CPU core.
Optionally, the step of obtaining the running information of each CPU core of the computer of the database management system further includes:
calculating a busy index according to the overall memory use condition and the disk operation condition of the computer;
comparing the busy index with a preset threshold;
and if the busy index is smaller than a preset threshold value, a step of selecting a CPU kernel as a process processing kernel according to the running information is executed.
Optionally, the step of comparing the busy index with a preset threshold further includes:
and when the busy index is larger than the preset threshold, the operation of binding the CPU kernel is not performed, and the subsequent service is continuously executed.
Optionally, the database service process to be optimized includes:
a newly started service process of the database; and/or
Service processes that have started but need to be optimized in the database.
Optionally, the step of obtaining the database service process to be optimized further includes:
judging whether the database starts the function of the database binding kernel;
if so, the subsequent operation is executed.
According to another aspect of the present invention, there is also provided a machine-readable storage medium having stored thereon a machine-executable program which, when executed by a processor, performs a method of performance optimization of a database according to any one of the above.
According to yet another aspect of the present invention, there is also provided a computer device comprising a memory, a processor and a machine executable program stored on the memory and running on the processor, and the processor when executing the machine executable program implements the method for performance optimization of a database of any of the above.
The performance optimization method of the database selects one CPU kernel as a process processing kernel according to the running information of each CPU kernel of a computer of a database management system aiming at the database service process to be optimized, and binds the database service process to be optimized to the process processing kernel, so that the process processing kernel processes the database service process to be optimized. Therefore, the database service process is bound to a specific CPU kernel, the hit rate of a CPU Cache (a high-speed buffer memory) is improved, the CPU resource of the current computer can be more effectively used when the database runs, and the execution efficiency of the database is improved.
Further, the performance optimization method of the database calculates the utilization rate of each CPU by obtaining the operation information of each CPU kernel of the computer of the database management system, and sorts the utilization rate of each CPU according to the binding condition of the CPU and the service process of the database. Then, obtaining a busy index through calculation according to the overall memory use condition and the disk operation condition of the computer, and comparing the busy index with a preset threshold; if the busy index is smaller than a preset threshold value, selecting a CPU kernel with the minimum utilization rate as a process processing kernel according to the running information to be bound with the database service process; and if the busy index is larger than the preset threshold value, not executing the operation, and handing the database service process to the computer system for scheduling. In this way, in the actual operation process of the database, reasonable resource distribution can be performed according to the actual situation of the computer, and when the busy index of the computer is low, the database service process is bound to a specific CPU kernel, so that the hit rate of a CPU Cache (high-speed buffer memory) can be improved, and the execution efficiency of the database service process is improved.
Furthermore, the method for optimizing the performance of the database adds the option of whether to start the database service process to bind the CPU kernel in the database management system, so that a user can select whether to start the database service process to bind the CPU kernel according to the self condition when using the database, thereby improving the convenience of using the database.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the invention will be described in detail hereinafter, by way of illustration and not limitation, with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow diagram of a method for performance optimization of a database, according to one embodiment of the invention;
FIG. 2 is a flow diagram illustrating a method for optimizing performance of a database according to another embodiment of the present invention;
FIG. 3 is a flow diagram of an intelligent binding algorithm of a method for performance optimization of a database, according to one embodiment of the invention;
FIG. 4 is a flow diagram illustrating the operation of a database system of a method for optimizing the performance of a database, according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of a machine-readable storage medium in a method for performance optimization of a database according to one embodiment of the invention; and
fig. 6 is a schematic diagram of a computer device in a performance optimization method of a database according to an embodiment of the present invention.
Detailed Description
It should be understood by those skilled in the art that the embodiments described below are only a part of the embodiments of the present invention, not all of the embodiments of the present invention, and the part of the embodiments are intended to explain the technical principles of the present invention and not to limit the scope of the present invention. All other embodiments, which can be obtained by a person skilled in the art based on the embodiments provided by the present invention without inventive effort, shall still fall within the scope of protection of the present invention.
In the method of the embodiment, the database service process is bound with the CPU selected by the intelligent algorithm, so that the execution efficiency of the database is improved. FIG. 1 is a schematic flow diagram of a method for performance optimization of a database, generally including the steps of, according to one embodiment of the invention:
step S101, obtaining a database service process to be optimized. The database service process to be optimized may include: a newly started service process of the database, and/or a service process which is started in the database but needs to be optimized. In this way, all service processes in the database can be comprehensively optimized online after the database is updated.
Step S102, obtaining the operation information of each CPU inner core of the computer of the database management system. The operation information may include the usage rate and service process binding condition of each CPU core, the memory usage condition of the whole computer, and the disk operation condition. The memory usage condition generally refers to the occupation condition of the computer memory; the disk operation conditions generally include occupation conditions, read-write speeds and response times of the disks. The method generally comprises the following two operations, firstly, obtaining the utilization rate of each CPU kernel and the binding condition of a service process for the use of the step S103; and then, calculating a busy index according to the overall memory use condition and the disk operation condition of the computer, comparing the busy index with a preset threshold, if the busy index is smaller than the preset threshold, executing the step S103, if the busy index is larger than the preset threshold, indicating that the workload of the computer is larger at the moment, and at the moment, adopting an intelligent CPU (Central processing Unit) kernel binding method to improve the performance of the database to a limited extent, so that when the busy index is larger than the preset threshold, the database service process is normally handed to the computer system for scheduling processing.
The preset threshold value in the method can be flexibly set by professionals in the field according to actual conditions, and meanwhile, for the condition that the busy index is equal to the preset threshold value, the professionals in the field can also make judgment according to the actual conditions to judge whether to enable the function of intelligently binding the CPU core. Through the arrangement, when a large number of service processes are operated by the database, the optimal processing scheme can be intelligently selected to allocate CPU resources, and the execution efficiency of database service is improved.
And step S103, selecting a CPU kernel as a process processing kernel according to the running information. Determining the CPU kernels of which the service processes are not bound according to the binding condition of the database service processes through the operation information acquired in the step S102, sequencing the utilization rates of the CPU kernels of which the service processes are not bound, and taking the lowest utilization rate as a process processing kernel; and if the condition that the CPU inner cores of the service processes are not bound yet exists, sequencing the utilization rates of the CPU inner cores of the bound service processes, and taking the lowest utilization rate as a process processing inner core.
One preferable method for acquiring the utilization rate of each CPU core is as follows: the utilization rates of the CPU cores are sampled according to a set period, and further average calculation can be performed according to the sampled utilization rate values of the CPU cores (the average calculation period can be configured into a plurality of different time lengths, so that states reflecting the utilization rates of the CPU cores in different time lengths are obtained). The set period of the sampling and the average calculation time can be determined by those skilled in the art according to actual situations. The usage of each core of the computer CPU is acquired, for example, every second. And then calculating the average utilization rates of 10 seconds, 20 seconds and 30 seconds, finally calculating again according to the average utilization rates of the three time periods to obtain the overall average utilization rate, and sequencing the obtained average utilization rates as the utilization rates of the cores of the CPUs.
By the method, the most appropriate CPU core can be selected for the database service process more comprehensively on the premise of selecting the intelligent binding CPU core.
And step S104, binding the database service process to be optimized to the process processing kernel.
Step S105, the process processing kernel is used for processing the database service process to be optimized.
According to the database performance optimization method, when the busy index of the computer is lower than the preset threshold value, the CPU kernel which is most suitable for the inside of the computer at present is intelligently selected for the database service process, the database service process is bound to the CPU kernel, and then the database service process can always run in the CPU kernel, so that the hit rate of a CPU cache is improved, the computer can respond to the database service process more quickly, the execution efficiency of the database is improved, the CPU resource of the computer at present can be used more effectively by the database, and the performance of the database is improved more effectively.
Fig. 2 is a flowchart illustrating an intelligent bound CPU core of a database performance optimization method according to another embodiment of the present invention. The process comprises the following steps:
step S201, a service process is started. This means that the database receives a request from the outside and starts to execute the corresponding database service process.
Step S202, judging whether intelligent binding is selected. The method of the embodiment adds an option in the configuration file of the database so that a user can select whether to enable the intelligent binding CPU kernel function when using the database. When the database management system starts a database service process, whether the intelligent binding CPU kernel function is started or not is judged according to the configuration file. Therefore, the database can determine whether to start the intelligent binding CPU core function according to the intention of the user, and the convenience of using the database is improved.
And step S203, when the judgment result in the step S202 is negative, namely when intelligent binding is not selected, the core binding operation is not performed, and the scheduling of the CPU is handed to an operating system.
Step S204, if the determination result in step S202 is yes, that is, if the intelligent binding is selected, then the running information of all CPU cores in the operating system is acquired.
And step S205, selecting a CPU core which can be used for binding according to an intelligent algorithm, and binding the CPU core with the database service process. The intelligent algorithm flow comprises the following steps: calculating the utilization rate of CPU cores in a computer where a database is located, intelligently classifying according to the binding condition of the CPU and the database service process, then judging whether the working condition of the computer at the moment determines to perform binding operation, if so, selecting the CPU core with the lowest utilization rate in a CPU list of the unbound database service process, and binding the CPU core with the database service process; if all the CPU kernels are bound with the database service progress, selecting the CPU kernel with the lowest utilization rate from the CPU list of the bound database service progress, and binding the CPU kernel with the database service progress. Therefore, through the intelligent algorithm, the most appropriate CPU kernel can be selected for the database service process and bound.
In step S206, the subsequent operation is performed in the bound CPU core.
According to the process for intelligently binding the CPU core, the option of whether to start intelligent binding is added in the configuration file of the database in advance, so that a user can determine whether to improve the performance of the database in such a way, and the database is more convenient to use; meanwhile, the intelligent core binding function of the database intelligently selects the most suitable CPU core for the database service process through an intelligent algorithm, and the database service process is bound to the CPU core, and the subsequent database service process can always run in the CPU core, so that the hit rate of the CPU cache is improved, the response speed and the execution efficiency of the database are improved, the resources of a computer are reasonably distributed, and the performance of the database is improved.
Fig. 3 is a flowchart illustrating an intelligent binding algorithm of a database performance optimization method according to an embodiment of the present invention. The intelligent binding algorithm of the database performance optimization method comprises the following steps:
it should be noted that, the place related to time in the algorithm can be decided by those skilled in the art according to the actual situation, and the present flow only provides an example of the intelligent binding algorithm.
Step S301, acquiring the utilization rate of each core of the CPU of the computer at regular intervals, calculating the average utilization rate of a plurality of time periods and the overall average utilization rate of all CPU cores, and sequencing. Further, average calculation may be performed according to the sampled usage rate values of the CPU cores (the average calculation period may be configured to a plurality of different durations, so as to obtain states reflecting the usage rates of the CPU cores in different durations). The set period of the sampling and the average calculation time can be determined by those skilled in the art according to actual situations. Specific examples of this step include: the utilization rate of each core of the CPU of the computer is obtained every 1 second, and the average utilization rates of 10 seconds, 20 seconds and 30 seconds and the overall average utilization rate of all CPU cores are calculated at the same time, so that the average utilization rates of 10 seconds, 20 seconds and 30 seconds are calculated according to the utilization rate of each second, then the average utilization rate of each CPU core is calculated overall, and then the sequencing is carried out. The purpose of doing so is to obtain the average utilization rate of each CPU core every second more comprehensively, make the data more objective and true, avoid influencing the overall judgment of the intelligent binding algorithm because of the fluctuation of a certain period of time. The algorithm of the utilization rate of each CPU core can be designed according to the actual situation by those skilled in the art.
Step S302, acquiring process binding information of each core of the CPU of the computer at regular intervals to obtain a non-process binding CPU list and a process binding CPU list.
Step S303, acquiring the overall memory use condition and the disk operation condition of the computer every fixed period, and calculating a busy index. The busy index is data expressing the use of the computer in which the database is located. The memory usage condition generally refers to the occupation condition of the computer memory; the disk operation conditions generally include occupation conditions, read-write speeds and response times of the disks. A specific example of this embodiment is set to 1-100, and when the data is larger, it means that the computer is busy, that is, the workload of the computer at this time is large, and when the data is smaller, it means that the computer is idle, that is, the workload of the computer at this time is small. The algorithm and the meaning of the busy index calculation can be set by a person skilled in the art according to the actual situation.
Step S304, comparing the busy index with a preset threshold value. The preset threshold is a threshold obtained by a person skilled in the art through actual tests according to different conditions of a computer, and when the calculated busy index is smaller than the preset threshold, the execution efficiency and performance of the database can be greatly improved by adopting the method of intelligently binding the CPU core; when the busy index obtained by calculation exceeds a preset threshold value, the actual workload of the computer is large, and the performance improvement degree of the database is limited by adopting the method of intelligently binding the CPU kernel. Therefore, the preset threshold is generated to intelligently select different processing methods according to different situations of the computer, so that the performance of the database is improved to the maximum extent.
Step S305, judging whether the busy index is smaller than a preset threshold value. Namely, whether the working condition calculated at the moment is suitable for adopting the intelligent binding operation is judged.
It should be noted that, when the busy index is equal to the preset threshold, for such a situation, a person skilled in the art may select whether to use the intelligent binding operation according to the actual situation.
And step S306, if the judgment result is negative, the operation of binding the core is not carried out, and the dispatching of the CPU is handed to an operating system. At this time, the performance improvement degree of the database by adopting the method of intelligently binding the CPU core is possibly limited, so that the core binding operation is not performed, and the dispatching of the CPU is handed to an operating system.
In step S307, if yes, the CPU core number with the minimum average usage rate of the CPU cores in the unbound process list is selected. When the determination in step S305 is yes, it indicates that the performance of the computer after being optimized by the intelligent binding operation is significantly higher than the automatic scheduling of the computer operating system, so that the intelligent binding operation is automatically executed.
In step S308, it is determined whether or not the CPU core number is obtained in step S307.
In step S309, if no, the CPU core number with the minimum average utilization rate of the CPU cores of the bound process list is selected. If the determination result in the step S308 is negative, it indicates that no CPU core exists in the unbound process list, that is, the cores of all CPUs in the computer have bound the database service process, and at this time, the CPU core number with the minimum average utilization rate of the CPU core is obtained from the bound process list.
And step S310, if the step S308 is judged to be yes or the step S309 is executed, binding the database service process according to the extracted valid CPU core number.
In the flow example of the intelligent binding algorithm of the embodiment, a utilization rate list of CPU cores is obtained by obtaining utilization rates of CPU cores of a computer and performing sort sorting according to whether a database service process has been bound; and then calculating a busy index according to the running condition of the computer, comparing the busy index with a preset value to judge whether intelligent binding operation is selected, and under the condition that the intelligent binding operation is selected, selecting a proper core number of the CPU core from the CPU core utilization rate list, and binding the database service process into the CPU core. Therefore, the purpose of intelligently binding the CPU inner core is achieved, the hit rate of the CPU cache when the computer processes the service process of the database can be improved, the response speed of the computer is improved, and the execution efficiency and the performance of the database are also improved.
Fig. 4 is a flowchart illustrating operations of a database system of a database performance optimization method according to an embodiment of the present invention. Which comprises the following steps:
it should be noted that the parts related to the numbers in the embodiment are only an example for explaining the method, and the person skilled in the art needs to determine the numbers according to the actual situation.
An example 401 of the operation information of the computer in this embodiment includes the number n1 of cores of the CPU (for example, 16 cores), the average usage rate of each core of the CPU, and a busy index n3 of the computer as a whole. N1 may be any number greater than 1, and a person skilled in the art may determine the value range of n3 according to the actual situation, where an optional example includes that n3 is 1-100 (or expressed in numerical manners such as percentage), and a larger number indicates that the computer is busy.
The number of requests 402 sent by a database client may be n2, where n2 may be 1 or more (e.g., 11 requests), representing the number of requests sent by the client.
After receiving the n2 client requests 402, the database management system 403 selects whether to start an intelligent binding operation in the database profile intelligent binding option 405 through the database service main process 404, and if so, performs the binding operation through the CPU intelligent binding module 406.
In the CPU intelligent core binding module 406, when the overall busy index n3 of the computer is less than the preset threshold, the CPU intelligent core binding module 406 starts to execute the intelligent binding operation, because the average usage rate of the CPU core 407 with id 1 in the unbound process is 2%, and is the smallest among all the unbound CPU cores, the database service process that processes the request 1 of the client is bound in the CPU core 407;
at this time, the average usage rate of the CPU core 408 whose id is 2 in the unbound process is 3%, and becomes the minimum among all the unbound CPU cores, so that the database service process that processes the request 2 of the client is bound among the CPU cores 408;
at this time, the average usage rate of the CPU kernel 409 whose id is n1 in the unbound process is 10%, which becomes the minimum among all the unbound CPU kernels, so that the database service process that processes the request n4 of the client is bound among the CPU kernels 409; after the database service processes are bound in all the CPU cores, the average utilization rate of the CPU core 407 is the minimum in the CPU core list of all the bound database service processes, so the database service process that processes the request n5 of the client is bound in the CPU core 407, and similarly, the database service process that processes the request n6 of the client is bound in the CPU core 408, and the operations are sequentially circulated until all the requests of all the clients are bound. Where it is to be explained that n4, n5, n6 are a number of client requests with a size in the range of 1-n2, including 1 and n2.
In addition, the database management system 403 further has other database management function modules, such as a checkpointer 410 (data saving module), a background writer 411 (cache write module), a war writer 412 (alarm log module), and an autovacuum launcher 413 (auto clean module).
The database management function module can realize various management functions of the database.
In the database system operation process of this embodiment, after a client sends a request, the inside of the database system first determines whether the client selects to start an intelligent binding operation, if so, a busy index is obtained according to the state of a computer to determine whether the busy index is smaller than a preset threshold, and if so, an intelligent binding module is called; the intelligent binding module sorts according to the average utilization rate of the CPU kernels, preferentially allocates the CPU kernels which are not bound with the database service processes and have the lowest average utilization rate to the database service processes, binds the CPU kernels and the database service processes, preferentially binds the CPU kernels with the lowest average utilization rate in the CPU kernels which have been bound with the database service processes if all the CPU kernels are bound with the database service processes, and sequentially operates until all the database service processes are bound. Therefore, the resources of the computer can be utilized to the maximum extent, and meanwhile, the database service process is bound to a single CPU kernel, so that the hit rate of the CPU cache can be improved, and the response speed and the execution efficiency of the database to the client are improved.
The embodiment also provides a machine-readable storage medium and a computer device. Fig. 5 is a schematic diagram of a machine-readable storage medium 501 according to one embodiment of the invention, and fig. 6 is a schematic diagram of a computer device 603 according to one embodiment of the invention.
The machine-readable storage medium 501 has stored thereon a machine-executable program 502, and when executed by a processor, the machine-executable program 502 implements the performance optimization method of the database of any of the above embodiments.
The computer device 603 may comprise a memory 601, a processor 602 and a machine executable program 502 stored on the memory 601 and running on the processor 602, and the processor 602 when executing the machine executable program 502 implements the method for performance optimization of a database of any of the embodiments described above.
It should be noted that the logic and/or steps illustrated in the flowcharts or otherwise described herein, such as the intelligent binding module, may be embodied in any machine-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
For the purposes of this description, a machine-readable storage medium 501 may be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the machine-readable storage medium 501 include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the machine-readable storage medium 501 may even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system.
The computer device 603 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smartphone. In some examples, computer device 603 may be a cloud computing node. The computer device 603 may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer device 603 may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
The computer device 603 may comprise a processor 602 adapted to execute stored instructions, a memory 601 providing temporary storage space for the operation of said instructions during operation. Processor 602 may be a single core processor, a multi-core processor, a computing cluster, or any number of other configurations. The memory 601 may include Random Access Memory (RAM), read only memory, flash memory, or any other suitable storage system.
The processor 602 may be connected via a system interconnect (e.g., PCI-Express, etc.) to an I/O interface (input/output interface) suitable for connecting the computer device 603 to one or more I/O devices (input/output devices). The I/O devices may include, for example, a keyboard and a pointing device, wherein the pointing device may include a touchpad or a touchscreen, among others. The I/O devices may be built-in components of the computer device 603, or may be devices that are externally connected to the computing device.
The processor 602 may also be linked through a system interconnect to a display interface suitable for connecting the computer device 603 to a display device. The display device may include a display screen that is a built-in component of the computer device 603. The display device may also comprise a computer monitor, television or projector, etc. externally connected to the computer device 603. In addition, a Network Interface Controller (NIC) may be adapted to connect the computer device 603 to a network over a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an internet small computer system interface, etc.) to transfer data. The network may be a cellular network, a radio network, a Wide Area Network (WAN)), a Local Area Network (LAN), the internet, or the like. The remote device may be connected to the computing device through a network.
The flowcharts provided in this example are not intended to indicate that the operations of the method are to be performed in any particular order, or that all of the operations of the method are to be included in each case. Further, the method may include additional operations. Additional variations on the above-described method are possible within the scope of the technical ideas provided by the method of this embodiment.
Thus, it should be appreciated by those skilled in the art that while various exemplary embodiments of the invention have been shown and described in detail herein, many other variations or modifications which are consistent with the principles of this invention may be determined or derived directly from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.

Claims (10)

1. A method of optimizing the performance of a database, comprising:
acquiring a database service process to be optimized;
acquiring running information of each CPU core of a computer of the database management system;
selecting one CPU kernel as a process processing kernel according to the running information;
binding the database service process to be optimized to the process processing kernel so that the database service process to be optimized is processed by the process processing kernel.
2. The method of optimizing performance of a database according to claim 1,
the step of acquiring the operation information of each CPU core of the computer of the database management system includes: acquiring the utilization rate of each CPU kernel and the binding condition of the service process;
the step of selecting one of the CPU kernels as a process processing kernel according to the operation information includes: determining a CPU kernel of which the service process is not bound according to the binding condition of the service process; and sequencing the utilization rates of the CPU kernels not bound with the service processes, and taking the lowest utilization rate as the process processing kernel.
3. The performance optimization method of a database according to claim 2,
after the step of determining that the CPU inner core of the service process is not bound according to the binding condition of the service process, the method further comprises the following steps:
and if the condition that the CPU kernel of the service process is not bound yet exists, sequencing the utilization rates of the CPU kernels of the bound service processes, and taking the lowest utilization rate as a process processing kernel.
4. The method of optimizing performance of a database according to claim 2,
the step of obtaining the utilization rate of each CPU core comprises the following steps:
sampling the utilization rate of each CPU core according to a set sampling period to obtain a utilization rate sampling value;
and calculating the average value of the sampling values according to a set period to serve as the utilization rate of the CPU core.
5. The performance optimization method of a database according to claim 1,
the step of obtaining the operation information of each CPU core of the computer of the database management system further includes:
calculating a busy index according to the memory use condition and the disk operation condition of the whole computer;
comparing the busy index with a preset threshold;
and if the busy index is smaller than a preset threshold value, the step of selecting one CPU kernel as a process processing kernel according to the running information is executed.
6. The method of optimizing performance of a database according to claim 5,
the step of comparing the busy index with a preset threshold further comprises:
and when the busy index is larger than a preset threshold value, the operation of binding the CPU kernel is not performed, and the subsequent service is continuously executed.
7. The method of optimizing performance of a database according to claim 1,
the database service process to be optimized comprises the following steps:
a newly started service process of the database; and/or
Service processes that have been started but need to be optimized in the database.
8. The performance optimization method of a database according to claim 1,
the step of obtaining the database service process to be optimized further comprises:
judging whether the database starts the function of the database binding kernel;
if yes, the subsequent operation is executed.
9. A machine readable storage medium having stored thereon a machine executable program which when executed by a processor implements a method of performance optimization of a database according to any one of claims 1 to 8.
10. A computer device comprising a memory, a processor and a machine-executable program stored on the memory and running on the processor, and the processor when executing the machine-executable program implements a method of performance optimization of a database according to any one of claims 1 to 8.
CN202310015941.1A 2023-01-05 2023-01-05 Database performance optimization method, storage medium and computer device Pending CN115982130A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310015941.1A CN115982130A (en) 2023-01-05 2023-01-05 Database performance optimization method, storage medium and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310015941.1A CN115982130A (en) 2023-01-05 2023-01-05 Database performance optimization method, storage medium and computer device

Publications (1)

Publication Number Publication Date
CN115982130A true CN115982130A (en) 2023-04-18

Family

ID=85962350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310015941.1A Pending CN115982130A (en) 2023-01-05 2023-01-05 Database performance optimization method, storage medium and computer device

Country Status (1)

Country Link
CN (1) CN115982130A (en)

Similar Documents

Publication Publication Date Title
US11570272B2 (en) Provisioning using pre-fetched data in serverless computing environments
US8424007B1 (en) Prioritizing tasks from virtual machines
CA2780231C (en) Goal oriented performance management of workload utilizing accelerators
CN102541460B (en) Multiple disc management method and equipment
US10367719B2 (en) Optimized consumption of third-party web services in a composite service
KR101471749B1 (en) Virtual machine allcoation of cloud service for fuzzy logic driven virtual machine resource evaluation apparatus and method
CN107273200B (en) Task scheduling method for heterogeneous storage
Bok et al. An efficient MapReduce scheduling scheme for processing large multimedia data
CN111625339A (en) Cluster resource scheduling method, device, medium and computing equipment
CN106775975B (en) Process scheduling method and device
CN114721818A (en) Kubernetes cluster-based GPU time-sharing method and system
CN110347546B (en) Dynamic adjustment method, device, medium and electronic equipment for monitoring task
CN113590274A (en) Task allocation method and device and task processing system
CN115982130A (en) Database performance optimization method, storage medium and computer device
CN116360921A (en) Cloud platform resource optimal scheduling method and system for electric power Internet of things
CN107391262B (en) Job scheduling method and device
US20140047454A1 (en) Load balancing in an sap system
CN115220908A (en) Resource scheduling method, device, electronic equipment and storage medium
US9483317B1 (en) Using multiple central processing unit cores for packet forwarding in virtualized networks
CN114077481A (en) Task scheduling method, device, equipment and storage medium
CN114399228A (en) Task scheduling method and device, electronic equipment and medium
CN116848508A (en) Scheduling tasks for computer execution based on reinforcement learning model
CN115994074A (en) Processing method of data testing tool, storage medium and computer equipment
CN112288506B (en) Information pushing method and device, electronic equipment and storage medium
CN113342477A (en) Container group deployment method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination