WO2015058578A1 - 一种分布式计算框架参数优化方法、装置及系统 - Google Patents

一种分布式计算框架参数优化方法、装置及系统 Download PDF

Info

Publication number
WO2015058578A1
WO2015058578A1 PCT/CN2014/084483 CN2014084483W WO2015058578A1 WO 2015058578 A1 WO2015058578 A1 WO 2015058578A1 CN 2014084483 W CN2014084483 W CN 2014084483W WO 2015058578 A1 WO2015058578 A1 WO 2015058578A1
Authority
WO
WIPO (PCT)
Prior art keywords
distributed computing
computing framework
job
historical
similarity
Prior art date
Application number
PCT/CN2014/084483
Other languages
English (en)
French (fr)
Inventor
方育柯
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015058578A1 publication Critical patent/WO2015058578A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5066Algorithms for mapping a plurality of inter-dependent sub-tasks onto a plurality of physical CPUs

Definitions

  • the present invention relates to the field of IT technologies, and in particular, to a distributed computing framework parameter optimization method, apparatus and system. Background technique
  • MapReduce is a general software framework proposed by Google to implement distributed parallel computing tasks. It simplifies the parallel software programming mode on a large cluster composed of ordinary computers, and can be used for parallel computing of large-scale data sets.
  • the parameter optimization strategy of the system parameters is directly related to the utilization of the overall resources of the system and the fairness of resources used among users. Therefore, the parameter optimization algorithm of system parameters has become a major challenge for MapReduce systems.
  • This technical solution 1 only gives a performance bottleneck detection method. No specific performance improvement scheme is given. In many cases, even if the performance bottleneck is known, the average user still does not know how to modify the parameters. Even if the user knows how to modify the MapReduce parameters, the implementation efficiency of this scheme is very low, and it is necessary to manually and repeatedly try to achieve better performance, so the problem of rationalizing and automating the configuration of MapReduce parameters cannot be solved.
  • the purpose of the embodiments of the present invention is to provide a distributed computing framework parameter optimization method, which aims to solve the problem of rationalizing, automating, and self-learning the MapReduce parameter configuration.
  • a method for parameter optimization of a distributed computing framework includes:
  • a historical distributed computing framework job similar to the distributed computing framework job is retrieved;
  • the configuration parameters of the distributed computing framework job are optimally configured according to configuration parameters of a similar historical distributed computing framework job.
  • the historical distributed computing framework operations of the same type as the distributed computing framework operations are retrieved, including: When the distributed computing framework job does not have a specified distributed computing framework operational parameter, in the distributed computing framework historical job running database, a historical distributed computing framework job of the same type as the distributed computing framework job is retrieved.
  • configuration parameters of the distributed computing framework job are optimally configured according to configuration parameters of a similar historical distributed computing framework job, including:
  • obtaining the highest scored historical distributed computing framework job using the highest ranked historical distributed computing framework job configuration parameters as the configuration parameters of the distributed computing framework job,
  • the configuration parameters of the distributed computing framework job are optimally configured.
  • the distributed computing framework job execution information and configuration parameters are collected;
  • the distributed computing framework job execution information is scored and the distributed computing framework job is saved to the distributed computing framework historical job database.
  • the distributed computing framework job execution information is scored, specifically:
  • the distributed computing framework job runs are scored based on a scoring model of pre-established distributed computing framework jobs, and the time consumption cost and space consumption cost of the distributed computing framework job run.
  • the scoring model prior to scoring the distributed computing framework job operation, the scoring model based on the pre-established distributed computing framework job, and the time consumption cost and space consumption cost of the distributed computing framework job running, including :
  • the scoring model is among them, .
  • 3 ⁇ 4 ( ⁇ , ⁇ ) represents the score of a job running, which represents the corresponding time consumption cost, space consumption cost, and the function of the job execution score ⁇ ⁇ .
  • Is the weight of the time consumption cost score and the space consumption cost score i is the serial number of the medium attribute value of the time consumption cost, the first attribute value corresponding to the time consumption cost, and j is the serial number of the medium attribute value of the space consumption cost, ";
  • Representing the value of the / / ' attribute corresponding to the cost of space consumption, ⁇ corresponds to the weight of the above two attributes, respectively, wherein the parameter is used to adjust the set time consumption cost and the space consumption cost which is more preferred;
  • ⁇ , ⁇ purpose In order to eliminate the difference in the magnitude of each cost attribute value, the normalized calculation 3 ⁇ 4 ( , ) is set by setting ⁇ , ⁇ .
  • the distributed computing framework job is saved to the distributed computing framework historical job database, specifically:
  • the distributed computing framework job is saved to the distributed computing framework historical job database in a tree storage manner.
  • a historical distributed computing framework job similar to the distributed computing framework job is retrieved, including: in a pre-established distributed computing framework historical running database
  • the search tree node method is used to retrieve a historical distributed computing framework job of the same type as the distributed computing framework job.
  • the retrieving a historical distributed computing framework job similar to the distributed computing framework job comprises:
  • the retrieving a historical score similar to the distributed computing framework job Fabric computing framework operations, including:
  • attribute fields of the distributed computing framework job and a historical distributed computing framework job where the attribute field includes a key attribute set and a non-critical attribute set;
  • the similarity of the job is the distributed computing framework operation and historical distribution Calculating the similarity of the framework operation
  • the similarity of the cluster environment information is a similarity between the similarity of the distributed computing framework operation and the historical distributed computing framework operation in the cluster environment information
  • the comprehensive similarity between the distributed computing framework operation and the historical distributed computing framework operation is generated according to a comprehensive similarity model of the pre-established distributed computing framework operation and a weighting strategy.
  • the method before the similarity model of the pre-established distributed computing framework job and the attribute field respectively generate the similarity of the job and the similarity of the cluster environment information, the method includes:
  • the similarity model is:
  • K is the key attribute set
  • k is the sequence number of the key attribute in the key attribute set
  • I is the non-key attribute set
  • i is the sequence number of the non-key attribute of the non-key attribute set, and represents the kth key attribute of the job ⁇
  • the method before generating the comprehensive similarity between the distributed computing framework operation and the historical distributed computing framework operation according to the comprehensive similarity model and the weighting strategy of the pre-established distributed computing framework operation, the method includes: Establish a comprehensive similarity model for distributed computing framework operations,
  • the comprehensive similarity model is:
  • the sim(JobA, JobB) indicates the job ⁇ 4, and the sim (ClusterA, ClusterE) indicates the similarity of the job AS in the cluster environment information.
  • ⁇ 4 indicates that the job AS refers to the similarity of the cluster environment information, "is the first weight parameter in the weighting policy, and ⁇ is the second weight parameter in the weighting policy.
  • a MapReduce parameter optimization apparatus includes:
  • An obtaining unit configured to obtain a currently submitted distributed computing framework job
  • a first retrieval unit configured to retrieve a historical distributed computing framework job of the same type as the distributed computing framework operation in a pre-established distributed computing framework historical running database, where the distributed computing framework historical running database includes a historical distribution Calculation information and configuration parameters of the framework operation;
  • a second retrieval unit configured to retrieve a historical distributed computing framework job similar to the distributed computing framework job in a distributed computing framework operation of the same type
  • a configuration unit configured to optimize configuration parameters of the distributed computing framework job according to configuration parameters of a similar historical distributed computing framework job.
  • the first retrieving unit includes:
  • a check subunit configured to check whether the distributed computing framework job has a specified distributed computing framework operating parameter
  • An execution subunit configured to: when the distributed computing framework job does not have a specified distributed computing framework running parameter, perform the same in the distributed computing framework historical job running database, and retrieve the same as the distributed computing framework operation The steps of the historical distributed computing framework job.
  • the configuration unit is further configured to obtain a historical distributed computing framework job with the highest score in a similar historical distributed computing framework operation, and use the configuration parameter of the highest-ranked historical distributed computing framework job as a Configuration parameters for distributed computing framework jobs Number, optimize configuration of the configuration parameters of the distributed computing framework job.
  • a collecting unit configured to collect operation information and configuration parameters of the distributed computing framework when the distributed computing framework job is completed
  • a scoring unit configured to score the distributed computing framework job execution information, and save the distributed computing framework job to the distributed computing framework historical job database.
  • the scoring unit includes:
  • Generating a subunit configured to generate a time consumption cost and a space consumption cost of the distributed computing framework job operation according to time consumption and space consumption of the distributed computing framework job running;
  • the scoring unit further includes:
  • the scoring model is
  • . 3 ⁇ 4 ( ⁇ , ⁇ ) represents the score of a job running, which represents the corresponding time consumption cost, space consumption cost, and the function of the job execution score ⁇ ⁇ .
  • Is the weight of the time consumption cost score and the space consumption cost score i is the serial number of the medium attribute value of the time consumption cost, the first attribute value corresponding to the time consumption cost, and j is the serial number of the medium attribute value of the space consumption cost, ";
  • Representing the value of the / ⁇ ' attribute corresponding to the cost of space consumption, ⁇ corresponds to the weight of the above two attributes, respectively, where the parameter is used to adjust the set time consumption cost and Space consumption cost of which is more preferred; object, ⁇ is to eliminate the cost of each of the different property values of the order of the difference, by providing a ⁇ , ⁇ to calculate the normalized 3 ⁇ 4 (,).
  • the scoring unit further includes:
  • the saving subunit is configured to save the distributed computing framework job into the distributed computing framework historical job database by using a tree storage manner.
  • the first retrieval unit includes:
  • the first retrieval sub-unit is configured to retrieve, in a pre-established distributed computing framework historical running database, a historical distributed computing framework operation similar to the distributed computing framework operation by using a search tree node manner.
  • the second retrieval unit includes:
  • a second retrieval subunit configured to retrieve whether the key attributes in the distributed computing framework job and the historical distributed computing framework job are equal
  • An similar subunit configured to: when the key attribute in the distributed computing framework job is equal to a key attribute in a historical distributed computing framework job, indicating that the historical distributed computing framework job is working with the distributed computing framework Similar historical distributed computing framework jobs.
  • the second retrieval unit further includes:
  • An obtaining sub-unit configured to obtain an attribute field of the distributed computing framework job and a historical distributed computing framework job, where the attribute field includes a key attribute set and a non-key attribute set;
  • a first generation subunit configured to generate, according to a similarity model of the pre-established distributed computing framework job and the attribute field, a similarity between the similarity of the job and the cluster environment information, where the similarity of the job is The similarity between the distributed computing framework job and the historical distributed computing framework job, the similarity of the cluster environment information is the similarity between the distributed computing framework job and the historical distributed computing framework job respectively in the cluster environment information Similarity;
  • a second generation subunit configured to generate the distributed computing framework job and historical distributed meter according to a comprehensive similarity model and a weighting strategy of a pre-established distributed computing framework job Calculate the comprehensive similarity of the framework operations.
  • the first generating subunit further includes:
  • the first establishing subunit is configured to establish a similarity model of the distributed computing framework job, where the similarity model is:
  • K is the key attribute set
  • k is the sequence number of the key attribute in the key attribute set
  • I is the non-key attribute set
  • i is the sequence number of the non-key attribute of the non-key attribute set, and represents the kth key attribute of the job ⁇
  • the second generating subunit further includes:
  • a second establishing subunit configured to establish a comprehensive similarity model of the distributed computing framework operation, wherein the comprehensive similarity model is:
  • the sim(JobA, JobB) indicates the job ⁇ 4, and the sim (ClusterA, ClusterE) indicates the similarity of the job AS in the cluster environment information.
  • ⁇ 4 indicates that the job AS refers to the similarity of the cluster environment information, "is the first weight parameter in the weighting policy, and ⁇ is the second weight parameter in the weighting policy.
  • the third aspect includes the parameter optimization device, the client of the submitted distributed computing framework job, and the computing management node, where the client of the distributed computing framework job and the computing management node pass the The parameter optimization device is connected.
  • the configuration parameters of the distributed computing framework job are optimally configured according to configuration parameters of a similar historical distributed computing framework job, thereby avoiding unreasonable parameter configuration and causing great waste of cluster computing resources.
  • the user is required to manually adjust the configuration parameters of the MapReduce job, the tuning mode is inefficient, and the configuration parameters are only suitable. It is used for the current task and does not have universality.
  • the user submits a Mapreduce job, it can automatically optimize the parameters and learn the Mapreduce jobs that have been run before, without re-optimizing the MapReduce parameters every time. , realization
  • Mapreduce job parameter configuration is rationalized, automated, and self-learning.
  • FIG. 1 is a flowchart of implementing a method for parameter optimization of a distributed computing framework according to an embodiment of the present invention
  • FIG. 2 is a flowchart of an implementation of a job of saving a distributed computing framework according to an embodiment of the present invention
  • FIG. 3 is a diagram showing a preferred example of a tree-stored distributed computing framework operation provided by an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a parameter optimization apparatus according to an embodiment of the present invention
  • FIG. 6 is a network architecture diagram of a distributed computing framework parameter optimization system provided by this embodiment
  • FIG. 7 is a schematic structural diagram of a parameter optimization apparatus according to an embodiment of the present invention. detailed description
  • FIG. 1 is a flowchart of a method for parameter optimization of a distributed computing framework according to an embodiment of the present invention
  • step S101 acquiring a currently submitted distributed computing framework job;
  • the distributed computing framework includes but is not limited to a parallel computing framework.
  • step S102 in a pre-established distributed computing framework historical running database, a historical distributed computing framework job similar to the distributed computing framework job is retrieved, and the distributed computing framework historical running database includes historical distributed Calculate execution information and configuration parameters of the framework job;
  • the distributed computing framework operation similar to the distributed computing framework operation is retrieved, and the retrieval is performed.
  • the implementation process of the distributed computing framework operation of the distributed computing framework is described in the following embodiments, and is not described herein.
  • the distributed computing framework operation is performed according to the specified distributed computing framework operating parameter
  • step S103 in a distributed computing framework operation of the same type, a historical distributed computing framework job similar to the distributed computing framework job is retrieved;
  • the distributed computing framework job when a distributed computing framework job similar to the distributed computing framework job is retrieved, the distributed computing framework job is retrieved through a pre-established similarity model in a similar distributed computing framework job. Similar distributed computing framework operations, the implementation of the distributed computing framework operations similar to the distributed computing framework operations are described in the following embodiments, and are not described herein.
  • step S104 according to a configuration parameter of a similar historical distributed computing framework job, Optimal configuration of the configuration parameters of the distributed computing framework job.
  • the configuration parameters of the distributed computing framework job are optimally configured according to configuration parameters of a similar historical distributed computing framework job, specifically, when a distribution similar to the distributed computing framework job is retrieved
  • the similar historical distributed computing framework job in the similar historical distributed computing framework job, the highest scored historical distributed computing framework job is obtained, and the configuration parameters of the highest scored historical distributed computing framework job are used as the distributed computing framework job.
  • the configuration parameter is configured to optimize configuration parameters of the distributed computing framework job, and execute the distributed computing framework operation, where the distributed computing framework historical running database includes execution information and configuration parameters of the historical distributed computing framework job.
  • the configuration parameters of the calculation framework job are used as the configuration reference for the current distributed computing framework job parameters, thus avoiding the unreasonable parameter configuration, causing a huge waste of cluster computing resources, and avoiding the user having to manually target the distributed computing framework.
  • the configuration parameters of the job are adjusted, the tuning mode is inefficient, and the configuration parameters are only applicable to the current task, and the generality is not available, so that when the user submits a distributed computing framework job, the parameters can be automatically configured automatically.
  • a historical distributed computing framework operation similar to the distributed computing framework operation is retrieved, including:
  • the distributed computing framework job does not have a specified distributed computing framework operating parameter, performing the searching in the distributed computing framework historical job running database, searching and distributing A step in the calculation of a framework-like historical distributed computing framework job.
  • the system when the task is submitted, the system obtains the parameter file in the distributed computing framework job, and checks whether there is a specified distributed computing framework running parameter through the parameter file.
  • the configuration parameters of the distributed computing framework job are optimally configured according to configuration parameters of a similar historical distributed computing framework job, and may also be in a similar historical distributed computing framework operation.
  • the configuration parameters of the distributed computing framework job are optimized, and the configuration parameters of the distributed computing framework job are optimally configured.
  • the new job Job-A its parameter settings can be calculated based on the following K most similar jobs A:
  • K is the number of selected jobs with a score greater than a certain threshold
  • A represents the 7th job in these jobs.
  • the new job parameters can be generated according to the similarity weighting calculation based on TopK scores. Because of the integration of multiple distributed computing framework job parameter configurations, the parameter optimization model of the new job can be made more stable.
  • FIG. 2 is a flowchart of an operation for saving a distributed computing framework according to an embodiment of the present invention, which is described in detail as follows:
  • S201 Collect, when the distributed computing framework job is executed, collecting the distributed computing framework job execution information and configuration parameters.
  • collecting distributed computing framework job execution information and configuration parameters includes: Collecting current cluster environment information and job configuration parameter information of the distributed computing framework job.
  • the cluster environment information includes, but is not limited to, the number of computing nodes, the total amount of memory, the total amount of CPUs, the size of the dfs block, the number of dfs copies, the network bandwidth, and the disk 10.
  • the job configuration parameters include, but are not limited to, a Mapper class, a Reducer class, a corresponding byte number, an input/output file format, a corresponding path, and split information.
  • the current cluster environment information and the job configuration parameter information of the distributed computing framework job are collected, and are mainly used for similarity calculation of subsequent distributed computing framework operations.
  • the scoring of execution information of a distributed computing framework job includes:
  • the distributed computing framework job runs are scored based on a pre-established scoring model of the distributed computing framework job, and the time consumption cost and space consumption cost of the distributed computing framework job run.
  • the time consumption is the time consumption of the cost attribute.
  • Table 1 is a preferred time consumption cost attribute table provided by an embodiment of the present invention, which includes a cost attribute name of a part of the calculation time consumption.
  • Cost attribute name The stage to which the cost belongs The description of the cost attribute
  • MapCPUCo Map processing stage A Map Task handles a record's stPerRec CPU time consumption
  • MapGCCost Map Processing Stage A Map Task handles a record's PerRec GC time consumption
  • CombineCP Shuffle phase Combiner merges a record of CPU UCost time consumption
  • PartitionCP Shuffle phase A recorded partition of the CPU when UCost consumption
  • ReduceCPU Reduce handles a Reduce Task processing CPU time consumption for a record CostPerRec phase
  • ReduceGCC Reduce processing A Reduce Task processing GC time consumption for a record ostPerRec phase
  • the time consumption cost of the distributed computing framework job run is generated according to the time consumption of the distributed computing framework job run. It can be calculated by the consumption of each phase and the amount of data input and output.
  • the time consumption cost table HdfsReadCost its time consumption cost per byte of HDFS read consumption, can be divided by the number of bytes read by the total time of byte read, generate HdfsReadCost time consumption cost (HDFS per byte) Reading time).
  • the space consumption is the space consumption of the cost attribute.
  • Table 2 is a preferred space consumption cost attribute table provided by an embodiment of the present invention, which includes a cost attribute name of a part of the calculation space consumption.
  • the space consumption cost of the distributed computing framework job running is generated according to the space consumption of the distributed computing framework job running. It can be calculated by the space consumption of each stage and the amount of data input and output. For example, the cost attribute name MapAvgMemBytes, whose space consumption cost is the average memory consumption per byte of the Map stage, is divided by the average memory consumption divided by the number of input records.
  • the specific calculation formula is as follows:
  • MapAvgMem is the average memory consumption
  • MapInputBytes is the number of records entered.
  • MapAvgMem and MapInputBytes can be obtained directly from Metrics in the distributed computing framework.
  • MapCPUCostPeiBytes has a space consumption cost of the average C P U consumption per byte of the Map stage, which is generated by dividing the total CPU memory consumption of the M A P stage by the number of input records.
  • the specific calculation formula is as follows:
  • MapCPUCostPerBytes MapCPUC ° St
  • the MapCPUCost and MapInputBytes fields can be distributed through the distributed computing framework.
  • the distributed computing framework operation operation is performed on the scoring model according to the pre-established distributed computing framework operation, and the time consumption cost and space consumption cost of the distributed computing framework job running.
  • the rating including:
  • the scoring model is
  • . 3 ⁇ 4 ( ⁇ , ⁇ ) represents the score of a job running, which represents the corresponding time consumption cost, space consumption cost, and the function of the job execution score ⁇ ⁇ .
  • Is the weight of the time consumption cost score and the space consumption cost score i is the serial number of the medium attribute value of the time consumption cost, the first attribute value corresponding to the time consumption cost, and j is the serial number of the medium attribute value of the space consumption cost, ";
  • Indicates the value of the / ⁇ ' attribute corresponding to the cost of space consumption, ⁇ corresponds to The weight of the above two attributes, where the parameter ", can be used to adjust the set time consumption cost and the space consumption cost which is more preferred; , the purpose is to eliminate the difference of the magnitude of each cost attribute value, and normalize the calculation by setting ⁇ 3 ⁇ 4 ( ⁇ , ⁇ ).
  • the distributed computing framework job is saved to the distributed computing framework historical job database, specifically:
  • the distributed computing framework job is saved to the distributed computing framework historical job database in a tree storage manner.
  • the tree-shaped storage mode is used, and the class name of the corresponding job is represented by the path from the root to the tree leaf node, and the distributed computing framework job is saved to the distributed computing framework historical job database. in.
  • FIG. 3 is a schematic diagram of a preferred example of a tree-shaped storage distributed computing framework operation according to an embodiment of the present invention.
  • the jobs of the same class name are stored in the same leaf node (as shown by the dashed box in the figure), so that when searching for the same distributed computing framework job, the user can quickly search.
  • a similar distributed computing framework job is stored in the same leaf node (as shown by the dashed box in the figure), so that when searching for the same distributed computing framework job, the user can quickly search.
  • a historical distributed computing framework operation similar to the distributed computing framework operation is retrieved, including:
  • the search tree node mode is used to retrieve the distributed computing framework operations stored in the same tree as the distributed computing framework.
  • the search tree node mode is used to retrieve the distributed computing framework jobs stored in the same tree as the distributed computing framework. For example, refer to Figure 5, for the job of com.huawei.pagerank.PageRank-1, pass the node
  • the retrieving a historical distributed computing framework job similar to the distributed computing framework job includes:
  • attribute fields of the distributed computing framework job and a historical distributed computing framework job where the attribute field includes a key attribute set and a non-critical attribute set;
  • the similarity of the job is the distributed computing framework operation and historical distribution Calculating the similarity of the framework operation
  • the similarity of the cluster environment information is a similarity between the similarity of the distributed computing framework operation and the historical distributed computing framework operation in the cluster environment information
  • the comprehensive similarity between the distributed computing framework operation and the historical distributed computing framework operation is generated according to a comprehensive similarity model of the pre-established distributed computing framework operation and a weighting strategy.
  • Table 3 is a preferred attribute field table provided by an embodiment of the present invention, which includes fields used in partial distributed computing framework job similarity calculation.
  • Table 4 is an attribute field table of a preferred cluster environment provided by an embodiment of the present invention, which includes a field used in partial distributed computing framework job similarity calculation.
  • the method before the similarity model of the pre-established distributed computing framework job and the attribute field respectively generate the similarity of the job and the similarity of the cluster environment information, the method includes: Establish a similarity model for distributed computing framework jobs,
  • the similarity model is:
  • is the key attribute set
  • k is the serial number of the key attribute in the key attribute set
  • I is the non-key attribute set
  • i is the sequence number of the non-key attribute of the non-key attribute set, and represents the kth key attribute of the job ,
  • the comprehensive similarity model is:
  • sim(JobA, JobE) represents the similarity of the job
  • sim(ClusterA, ClusterE) represents the job
  • A is the similarity of the information in the cluster environment.
  • w ⁇ O S indicates that the job AS refers to the similarity of the cluster environment information, "is the first weight parameter in the weighting policy, and is the second weight parameter in the weighting policy.
  • the similarity between the jobs is obtained based on the above formula, and the parameter description is consistent with the above description.
  • the degree calculation can be simplified as: sim(ClusterA, ClusterB) -
  • FIG. 4 is a flowchart of a preferred implementation of the parameter optimization of the distributed computing framework provided by this embodiment, which is described in detail as follows:
  • FIG. 5 is a schematic structural diagram of a parameter optimization apparatus according to an embodiment of the present invention. For convenience of description, only parts related to the embodiment are shown, which are as follows:
  • An obtaining unit 51 configured to acquire a currently submitted distributed computing framework job
  • the first retrieving unit 52 is configured to retrieve, in a pre-established distributed computing framework historical running database, a historical distributed computing framework job similar to the distributed computing framework job, where the distributed computing framework historical running database includes history Execution information and configuration parameters of the distributed computing framework job;
  • a second retrieval unit 53 for retrieving a historical distributed computing framework job similar to the distributed computing framework job in a distributed computing framework operation of the same type
  • the configuration unit 54 is configured to optimize configuration parameters of the distributed computing framework job according to configuration parameters of a similar historical distributed computing framework job.
  • the first retrieving unit includes:
  • a check subunit configured to check whether the distributed computing framework job has a specified distributed computing framework operating parameter
  • An execution subunit configured to: when the distributed computing framework job does not have a specified distributed computing framework running parameter, perform the same in the distributed computing framework historical job running database, and retrieve the same as the distributed computing framework operation The steps of the historical distributed computing framework job.
  • the configuration unit is further configured to acquire a historically distributed computing framework job with the highest score in a similar historical distributed computing framework job, and use the configuration of the highest-rated historical distributed computing framework job.
  • the parameter is used as a configuration parameter of the distributed computing framework job, and the configuration parameters of the distributed computing framework job are optimally configured.
  • the method further includes:
  • a collecting unit configured to collect operation information and configuration parameters of the distributed computing framework when the distributed computing framework job is completed
  • a scoring unit configured to score the distributed computing framework job execution information, and save the distributed computing framework job to the distributed computing framework historical job database.
  • the scoring unit includes:
  • Obtaining a subunit configured to acquire time consumption and space consumption of the distributed computing framework job running; Generating a subunit, configured to generate a time consumption cost and a space consumption cost of the distributed computing framework job operation according to time consumption and space consumption of the distributed computing framework job operation;
  • the scoring unit further includes:
  • the scoring model is
  • Is the weight of the time consumption cost score and the space consumption cost score i is the serial number of the medium attribute value of the time consumption cost, the first attribute value corresponding to the time consumption cost, and j is the serial number of the medium attribute value of the space consumption cost, "; Representing the 'th attribute value corresponding to the space consumption cost, ⁇ corresponds to the weight of the above two attributes respectively, wherein the parameter is used to adjust the set time consumption cost and the space consumption cost which is more preferential; ⁇ , ⁇ is for the purpose Eliminate the difference in the magnitude of each cost attribute value, and normalize the calculation by setting ⁇ , ⁇ 3 ⁇ 4 ( , ).
  • the scoring unit further includes:
  • the saving subunit is configured to save the distributed computing framework job to the distributed computing framework historical job database by using a tree storage manner.
  • the first retrieving unit includes:
  • the first retrieval sub-unit is configured to retrieve, in a pre-established distributed computing framework history running database, a historical distributed computing framework operation similar to the distributed computing framework operation by using a search tree node manner.
  • the second retrieval unit includes:
  • a second retrieval subunit configured to retrieve whether the key attributes in the distributed computing framework job and the historical distributed computing framework job are equal
  • An similar subunit configured to: when the key attribute in the distributed computing framework job is equal to a key attribute in a historical distributed computing framework job, indicating that the historical distributed computing framework job is working with the distributed computing framework Similar historical distributed computing framework jobs.
  • the second retrieving unit further includes:
  • An obtaining sub-unit configured to acquire an attribute field of the distributed computing framework job and a historical distributed computing framework job, where the attribute field includes a key attribute set and a non-key attribute set;
  • the first generating sub-unit is configured to be pre-established according to the The similarity model of the distributed computing framework job and the attribute field respectively generate the similarity of the job and the similarity of the cluster environment information, and the similarity of the job is the distributed computing framework job and the historical distributed computing framework a similarity of the job, the similarity of the cluster environment information is a similarity between the similarity of the distributed computing framework job and the historical distributed computing framework job in the cluster environment information, and a second generation subunit,
  • the comprehensive similarity between the distributed computing framework job and the historical distributed computing framework operation is generated according to a comprehensive similarity model of the pre-established distributed computing framework operation and a weighting strategy.
  • the first generating subunit further includes:
  • the first establishing subunit is configured to establish a similarity model of the distributed computing framework job, where the similarity model is:
  • K is the key attribute set
  • k is the serial number of the key attribute in the key attribute set
  • I is the non-key attribute set
  • i is the serial number of the non-key attribute of the non-key attribute set
  • the kth key attribute of industry A is to identify the i-th non-critical attribute of job A, and to identify the k-th key attribute of job B, to identify the i-th non-critical attribute of job B.
  • the second generating subunit further includes:
  • a second establishing subunit configured to establish a comprehensive similarity model of the distributed computing framework operation, wherein the comprehensive similarity model is:
  • JobA, JobB represents the similarity of job A
  • sim ClusterA, ClusterB
  • A is the similarity of the information in the cluster environment.
  • w ⁇ O S indicates that the job AS refers to the similarity of the cluster environment information, "is the first weight parameter in the weighting policy, and is the second weight parameter in the weighting policy.
  • a distributed computing framework parameter optimization system As a preferred embodiment of the present invention, a distributed computing framework parameter optimization system, a parameter optimization apparatus, a client of a submitted distributed computing framework job, and a computing management node, wherein the client of the distributed computing framework job A connection is made between the computing management node and the parameter optimization device.
  • FIG. 6 is a network architecture diagram of a distributed computing framework parameter optimization system provided by this embodiment.
  • the parameter automatic optimization configuration module is located between the distributed computing framework job submission client and the distributed computing framework master.
  • the parameter optimization configuration module performs a series of automated parameter configuration on the task, and then submits it to the computing management node Master of the distributed computing framework, and then the distributed by the master.
  • the compute framework job is assigned to perform tasks on multiple worker nodes under the jurisdiction.
  • FIG. 7 is a schematic structural diagram of a parameter optimization apparatus according to an embodiment of the present invention.
  • the specific embodiment of the present invention does not limit the specific implementation of the parameter optimization apparatus.
  • the parameter optimization apparatus 700 includes:
  • the processor 701, the communication interface 702, and the memory 703 complete communication with each other via the bus 704.
  • a communication interface 702 configured to communicate with other communication devices
  • the processor 701 is configured to execute a program.
  • the program can include program code, the program code including computer operating instructions.
  • the processor 701 may be a central processing unit (English: central processing unit, abbreviated: CPU.
  • the memory 703 is configured to store a program.
  • the program is configured to obtain a currently submitted parallel computing framework (distributed computing framework, distributed computing framework) job, and check whether the distributed computing framework job has a specified distributed computing framework operating parameter;
  • the distributed computing framework history running database includes execution information and configuration parameters of a historical distributed computing framework job; and is used to retrieve a history similar to the distributed computing framework job in a distributed computing framework operation of the same type A distributed computing framework job; configured to optimally configure configuration parameters of the distributed computing framework job according to configuration parameters of a similar historical distributed computing framework job.

Abstract

适用于IT技术领域,提供了一种分布式计算框架参数优化方法、装置及系统。方法包括:获取当前提交的并行计算框架作业;在分布式计算框架历史运行数据库中,检索与分布式计算框架作业同类的历史分布式计算框架作业,分布式计算框架历史运行数据库包括历史分布式计算框架作业的执行信息及配置参数;在同类的分布式计算框架作业中,检索与分布式计算框架作业相似的历史分布式计算框架作业;根据相似的历史分布式计算框架作业的配置参数,对分布式计算框架作业的配置参数进行优化配置。该方法、装置及系统能够实现Mapreduce作业参数配置合理化、自动化以及自学习。

Description

一种分布式计算框架参数优化方法、 装置及系统 技术领域 本发明属于 IT技术领域, 尤其涉及一种分布式计算框架参数优化方 法、 装置及系统。 背景技术
随着全球信息产业在不断融合发展, 网络资源与数据规模也在不断增 长, 尤其是在互联网应用、 电子商务等领域,数据量呈现快速增长的趋势, 为了解决这些数据密集型计算问题, 云计算应运而生, 而 Map/Reduce编 程模型作为一种简化大规模数据处理的重要手段得到越来越广泛的应用。 MapReduce是 Google提出的一种实现分布式并行计算任务的通用软件框 架, 它简化了由普通计算机组成的超大集群上的并行软件编程模式, 可用 于大规模数据集的并行计算。 MapReduce分布式计算系统中, 系统参数的 参数优化策略直接关系到系统整体资源的利用率以及各用户间使用资源 的公平性。 因此, 系统参数的参数优化算法成为 MapReduce系统面临的一 大挑战。
然而, 当前常见的 MapReduce参数优化的方案有两种, 详述如下:
1、 运行 Mapreduce作业时, 通过监控工具如 nmon, 监视集群系统的 性能指标(如 CPU使用率, 内存使用率, 磁盘和网络 I/O等) , 来快速检 测性能瓶颈, 协助工程师更有针对性的对性能瓶颈点进行参数改进和优 化。
2、 通过在一个模拟集群上预先执行 Mapreduce作业, 同时监控该任 务的运行特征 (包括输出文件, 各阶段运行时间, 处理和传输的数据量, 以及工作进程占用的各资源信息等等) , 计算每个阶段消耗资源的代价, 然后通过修改资源参数 , 预估实际 Mapreduce作业的运行时间 , 直到运行 时间达到可以接受范围, 从而到 MapReduce性能优化的目的。
该技术方案 1主要缺点是只是给出了性能瓶颈点检测方法, 没有给出 具体的性能改进方案, 很多情况下即使知道性能瓶颈点, 普通用户依然不 知道如何修改参数。 即便用户知道怎么修改 MapReduce参数,但是这种方 案实施效率也很低, 需要人工反复尝试多次, 才能使性能达到较优值, 因 此无法解决 MapReduce参数配置合理化、 自动化的问题。
该技术方案 2主要缺点是以增加程序的预执行和分析为代价, 并且由 于这种方案是针对单个任务进行的调优, 当用户提交的任务类型复杂多变 时, 每次都要重新进行预执行, 使得其通用性降低, 因此无法解决 MapReduce参数配置自学习的问题。 发明内容
本发明实施例的目的在于提供分布式计算框架参数优化方法, 旨在解 决 MapReduce参数配置合理化、 自动化以及自学习的问题。
第一方面, 一种分布式计算框架参数优化的方法, 包括:
获取当前提交的分布式计算框架作业;
在预先建立的分布式计算框架历史运行数据库中, 检索与所述分布式 计算框架作业同类的历史分布式计算框架作业, 所述分布式计算框架历史 运行数据库包括历史分布式计算框架作业的执行信息及配置参数;
在同类的分布式计算框架作业中, 检索与所述分布式计算框架作业相 似的历史分布式计算框架作业;
根据相似的历史分布式计算框架作业的配置参数, 对所述分布式计算 框架作业的配置参数进行优化配置。
结合第一方面, 所述在分布式计算框架历史作业运行数据库中, 检索 与所述分布式计算框架作业同类的历史分布式计算框架作业, 包括: 当所述分布式计算框架作业不存在指定的分布式计算框架运行参数 时, 在分布式计算框架历史作业运行数据库中, 检索与所述分布式计算框 架作业同类的历史分布式计算框架作业。
结合第一方面, 所述根据相似的历史分布式计算框架作业的配置参 数, 对所述分布式计算框架作业的配置参数进行优化配置, 包括:
在相似的历史分布式计算框架作业中, 获取评分最高的历史分布式计 算框架作业, 使用评分最高的历史分布式计算框架作业的配置参数作为所 述分布式计算框架作业的配置参数, 对所述分布式计算框架作业的配置参 数进行优化配置。
结合第一方面, 当所述分布式计算框架作业执行完毕时, 收集所述分 布式计算框架作业执行信息及配置参数;
对所述分布式计算框架作业执行信息进行评分, 并将所述分布式计算 框架作业保存到所述分布式计算框架历史作业数据库中。
结合第一方面, 对所述分布式计算框架作业执行信息进行评分, 具体 为:
获取所述分布式计算框架作业运行的时间消耗和空间消耗; 根据所述分布式计算框架作业运行的时间消耗和空间消耗, 生成所述 分布式计算框架作业运行的时间消耗代价和空间消耗代价;
根据预先建立的分布式计算框架作业的评分模型, 以及所述分布式计 算框架作业运行的时间消耗代价和空间消耗代价对分布式计算框架作业 运行进行评分。
结合第一方面, 在所述根据预先建立的分布式计算框架作业的评分模 型, 以及所述分布式计算框架作业运行的时间消耗代价和空间消耗代价对 分布式计算框架作业运行进行评分之前, 包括:
建立评分模型;
所述评分模型为 其中, 。¾(τ, υ)表示一个作业运行时的评分, 分别表示对应的时间 消耗代价、 空间消耗代价, 作业执行评分时^ ^的函数。 是时间消耗 代价评分和空间消耗代价评分的权重, i为时间消耗代价的中属性值的序 号, 对应于时间消耗代价的第 个属性值, j为空间消耗代价的中属性值 的序号, ";表示对应于空间消耗代价的第 ·/'个属性值, , ^则分别对应 上述两个属性的权重, 其中参数 用于可以调节设置时间消耗代价和 空间消耗代价哪个更优先; ^ , ^的目的是为了消除各代价属性值量级 不同的差异, 通过设置^ , ^来规范化的计算 ¾( , )。
结合第一方面, 所述将所述分布式计算框架作业保存到所述分布式 计算框架历史作业数据库中, 具体为:
釆用树形存储方式, 将所述分布式计算框架作业保存到所述分布式 计算框架历史作业数据库中。
结合第一方面, 在预先建立的分布式计算框架历史运行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业, 包括: 在预先建立的分布式计算框架历史运行数据库中, 釆用搜索树节点 方式, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业。
结合第一方面, 所述检索与所述分布式计算框架作业相似的历史分 布式计算框架作业, 包括:
检索所述分布式计算框架作业与历史分布式计算框架作业中的关键 属性是否相等;
当所述分布式计算框架作业中的关键属性与历史分布式计算框架作 业中的关键属性相等时, 表示所述历史分布式计算框架作业为与所述分布 式计算框架作业相似的历史分布式计算框架作业。
结合第一方面, 所述检索与所述分布式计算框架作业相似的历史分 布式计算框架作业, 还包括:
获取所述分布式计算框架作业和历史分布式计算框架作业的属性字 段, 所述属性字段包括关键属性集合和非关键属性集合;
根据预先建立的分布式计算框架作业的相似度模型以及所述属性字 段, 分别生成作业的相似度和集群环境信息的相似度, 所述作业的相似度 为所述分布式计算框架作业与历史分布式计算框架作业的相似度, 所述集 群环境信息的相似度为所述分布式计算框架作业与历史分布式计算框架 作业的相似度分别在所述集群环境信息的相似度;
根据预先建立的分布式计算框架作业的综合相似度模型以及加权策 略, 生成所述分布式计算框架作业与历史分布式计算框架作业的综合相似 度。
结合第一方面, 在所述根据预先建立的分布式计算框架作业的相似 度模型以及所述属性字段, 分别生成作业的相似度和集群环境信息的相似 度之前, 包括:
建立分布式计算框架作业的相似度模型,
所述相似度模型为:
Figure imgf000006_0001
其中 K为关键属性集合, k为关键属性集合的中关键属性的序号, I 为非关键属性集合, i为非关键属性集合的中非关键属性的序号 , 表示作 业 Α的第 k个关键属性, 为标识作业 A的第 i个非关键属性, ; 为标 识作业 B的第 k个关键属性, 为标识作业 B的第 i个非关键属性。
结合第一方面, 在根据预先建立的分布式计算框架作业的综合相似 度模型以及加权策略, 生成所述分布式计算框架作业与历史分布式计算框 架作业的综合相似度之前, 包括: 建立分布式计算框架作业的综合相似度模型,
所述综合相似度模型为:
sim(A,B) = x sim(JobA, JobB) + β x sim(C luster A, Cluster B)
其中 sim(JobA, JobB)表示作业 ^4, ό々 目以度, sim(ClusterA, ClusterE)表示作 业 AS分别在所述集群环境信息的相似度。 ^^4 )表示作业 AS之间参考 了集群环境信息的相似度, "为加权策略中的第一权重参数, ^为加权策 略中的第二权重参数。
结合第二方面, 一种 MapReduce参数优化装置, 包括:
获取单元, 用于获取当前提交的分布式计算框架作业;
第一检索单元, 用于在预先建立的分布式计算框架历史运行数据库 中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业, 所 述分布式计算框架历史运行数据库包括历史分布式计算框架作业的执行 信息及配置参数;
第二检索单元, 用于在同类的分布式计算框架作业中, 检索与所述分 布式计算框架作业相似的历史分布式计算框架作业;
配置单元, 用于根据相似的历史分布式计算框架作业的配置参数, 对 所述分布式计算框架作业的配置参数进行优化配置。
结合第二方面, 所述第一检索单元, 包括:
检查子单元, 用于检查所述分布式计算框架作业是否存在指定的分布 式计算框架运行参数;
执行子单元, 用于当所述分布式计算框架作业不存在指定的分布式计 算框架运行参数时, 执行所述在分布式计算框架历史作业运行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业的步骤。
结合第二方面, 所述配置单元, 还用于在相似的历史分布式计算框架 作业中, 获取评分最高的历史分布式计算框架作业, 使用评分最高的历史 分布式计算框架作业的配置参数作为所述分布式计算框架作业的配置参 数, 对所述分布式计算框架作业的配置参数进行优化配置。
结合第二方面, 还包括:
收集单元, 用于当所述分布式计算框架作业执行完毕时, 收集所述分 布式计算框架作业执行信息及配置参数;
评分单元, 用于对所述分布式计算框架作业执行信息进行评分, 并将 所述分布式计算框架作业保存到所述分布式计算框架历史作业数据库中。
结合第二方面, 所述评分单元, 包括:
获取子单元, 用于获取所述分布式计算框架作业运行的时间消耗和空 间消耗;
生成子单元, 用于根据所述分布式计算框架作业运行的时间消耗和空 间消耗, 生成所述分布式计算框架作业运行的时间消耗代价和空间消耗代 价;
评分子单元, 用于根据预先建立的分布式计算框架作业的评分模型, 以及所述分布式计算框架作业运行的时间消耗代价和空间消耗代价对分 布式计算框架作业运行进行评分。
结合第二方面, 所述评分单元, 还包括:
建立子单元, 用于建立评分模型;
所述评分模型为
其中, 。¾(τ,υ)表示一个作业运行时的评分, 分别表示对应的时间 消耗代价、 空间消耗代价, 作业执行评分时^ ^的函数。 是时间消耗 代价评分和空间消耗代价评分的权重, i为时间消耗代价的中属性值的序 号, 对应于时间消耗代价的第 个属性值, j为空间消耗代价的中属性值 的序号, ";表示对应于空间消耗代价的第 ·/'个属性值, , ^则分别对应 上述两个属性的权重, 其中参数 , 用于可以调节设置时间消耗代价和 空间消耗代价哪个更优先; , ^的目的是为了消除各代价属性值量级 不同的差异, 通过设置^ , ^来规范化的计算 ¾( , )。
结合第二方面, 所述评分单元, 还包括:
保存子单元, 用于釆用树形存储方式, 将所述分布式计算框架作业 保存到所述分布式计算框架历史作业数据库中。
结合第二方面, 第一检索单元, 包括:
第一检索子单元, 用于在预先建立的分布式计算框架历史运行数据 库中, 釆用搜索树节点方式, 检索与所述分布式计算框架作业同类的历史 分布式计算框架作业。
结合第二方面, 第二检索单元, 包括:
第二检索子单元, 用于检索所述分布式计算框架作业与历史分布式 计算框架作业中的关键属性是否相等;
相似子单元, 用于当所述分布式计算框架作业中的关键属性与历史 分布式计算框架作业中的关键属性相等时, 表示所述历史分布式计算框架 作业为与所述分布式计算框架作业相似的历史分布式计算框架作业。
结合第二方面, 第二检索单元, 还包括:
获取子单元, 用于获取所述分布式计算框架作业和历史分布式计算 框架作业的属性字段, 所述属性字段包括关键属性集合和非关键属性集 合;
第一生成子单元, 用于根据预先建立的分布式计算框架作业的相似 度模型以及所述属性字段, 分别生成作业的相似度和集群环境信息的相似 度, 所述作业的相似度为所述分布式计算框架作业与历史分布式计算框架 作业的相似度, 所述集群环境信息的相似度为所述分布式计算框架作业与 历史分布式计算框架作业的相似度分别在所述集群环境信息的相似度; 第二生成子单元, 用于根据预先建立的分布式计算框架作业的综合 相似度模型以及加权策略, 生成所述分布式计算框架作业与历史分布式计 算框架作业的综合相似度。
结合第二方面, 第一生成子单元, 还包括:
第一建立子单元, 用于建立分布式计算框架作业的相似度模型, 所述相似度模型为:
Figure imgf000010_0001
其中 K为关键属性集合, k为关键属性集合的中关键属性的序号, I 为非关键属性集合, i为非关键属性集合的中非关键属性的序号 , 表示作 业 Α的第 k个关键属性, 为标识作业 A的第 i个非关键属性, ; 为标 识作业 B的第 k个关键属性, 为标识作业 B的第 i个非关键属性。
结合第二方面, 第二生成子单元, 还包括:
第二建立子单元, 用于建立分布式计算框架作业的综合相似度模型, 所述综合相似度模型为:
sim(A,B) = x sim(JobA, JobB) + β x sim(C luster A, Cluster B)
其中 sim(JobA, JobB)表示作业 ^4, ό々 目以度, sim(ClusterA, ClusterE)表示作 业 AS分别在所述集群环境信息的相似度。 ^^4 )表示作业 AS之间参考 了集群环境信息的相似度, "为加权策略中的第一权重参数, ^为加权策 略中的第二权重参数。
第三方面, 包括上述的参数优化装置、 提交的分布式计算框架作业 的客户端以及计算管理节点, 其中, 所述分布式计算框架作业的客户端与 所述计算管理节点之间, 通过所述参数优化装置进行连接。
在本实施例中, 根据相似的历史分布式计算框架作业的配置参数, 对 所述分布式计算框架作业的配置参数进行优化配置, 从而避免了参数配置 不合理, 造成集群计算资源的极大浪费的情况, 同时避免了用户要手动对 MapReduce作业的配置参数进行调整, 调优方式效率低, 且配置参数只适 用于当前任务, 不具备通用性的情况, 使得在用户提交一个 Mapreduce作 业时, 能够自动的对参数进行优化配置, 能够学习之前已经运行过的 Mapreduce作业, 而不需要每次都重新优化 MapReduce参数, 实现
Mapreduce作业参数配置合理化、 自动化以及自学习。
附图说明
图 1是本发明实施例提供的一种分布式计算框架参数优化的方法的 实现流程图;
图 2是本发明实施例提供的保存分布式计算框架作业的实施流程图; 图 3是本发明实施例提供的树形存储分布式计算框架作业的较佳的样 例图;
图 4是本实施例提供的分布式计算框架参数优化的较佳的实施流程 图;
图 5是本发明实施例提供的一种参数优化装置的结构示意图; 图 6是本实施例提供的分布式计算框架参数优化系统较佳的网络架构 图;
图 7是本发明实施例提供的一种参数优化装置的结构示意图。 具体实施方式
为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图 及实施例, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体 实施例仅仅用以解释本发明, 并不用于限定本发明。
图 1是本发明实施例提供的一种分布式计算框架参数优化的方法的实 现流程图;
在步骤 S 101中, 获取当前提交的分布式计算框架作业; 在本实施例中, 分布式计算框架包括但不限于并行计算框架
Maprsduc
在步骤 S 102中, 在预先建立的分布式计算框架历史运行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业, 所述分 布式计算框架历史运行数据库包括历史分布式计算框架作业的执行信息 及配置参数;
在本实施例中, 通过存放分布式计算框架作业的分布式计算框架历史 运行数据库中, 根据分布式计算框架作业的同类标识, 检索与分布式计算 框架作业同类的分布式计算框架作业, 检索与分布式计算框架作业同类的 分布式计算框架作业的实施过程,在下述实施例进行说明,在此不做赘述。
在本实施例中, 当所述分布式计算框架作业存在指定的分布式计算框 架运行参数时, 按照指定的分布式计算框架运行参数执行所述分布式计算 框架作业;
在步骤 S 103中, 在同类的分布式计算框架作业中, 检索与所述分布 式计算框架作业相似的历史分布式计算框架作业;
在本实施例中, 检索分布式计算框架作业与历史分布式计算框架作 业中的关键属性是否相等, 当分布式计算框架作业中的关键属性与历史分 布式计算框架作业中的关键属性相等时, 也就是两者的关键属性的数值一 致时, 表示该历史分布式计算框架作业为与分布式计算框架作业相似的历 史分布式计算框架作业。
在本实施例中, 当检索到与分布式计算框架作业同类的分布式计算框 架作业时,在同类的分布式计算框架作业中,通过预先建立的相似度模型, 检索与该分布式计算框架作业相似的分布式计算框架作业, 检索与该分布 式计算框架作业相似的分布式计算框架作业的实施过程, 在下述实施例进 行说明, 在此不做赘述。
在步骤 S 104中, 根据相似的历史分布式计算框架作业的配置参数, 对所述分布式计算框架作业的配置参数进行优化配置。
在本实施例中, 根据相似的历史分布式计算框架作业的配置参数, 对 所述分布式计算框架作业的配置参数进行优化配置, 具体地, 当检索到与 该分布式计算框架作业相似的分布式计算框架作业时, 在相似的历史分布 式计算框架作业中, 获取评分最高的历史分布式计算框架作业, 使用评分 最高的历史分布式计算框架作业的配置参数作为所述分布式计算框架作 业的配置参数, 对所述分布式计算框架作业的配置参数进行优化配置, 并 执行该分布式计算框架作业, 该分布式计算框架历史运行数据库包括历史 分布式计算框架作业的执行信息及配置参数。
在本实施例中, 通过分析分布式计算框架作业运行历史信息, 寻找与 当前分布式计算框架作业相似的一系列分布式计算框架作业, 从分布式计 算框架历史库中找到一套评分最高的分布式计算框架作业的配置参数, 作 为当前分布式计算框架作业参数的配置参考, 从而避免了参数配置不合 理, 造成集群计算资源的极大浪费的情况, 同时避免了用户要手动对分布 式计算框架作业的配置参数进行调整, 调优方式效率低, 且配置参数只适 用于当前任务, 不具备通用性的情况, 使得在用户提交一个分布式计算框 架作业时, 能够自动的对参数进行优化配置, 能够学习之前已经运行过的 分布式计算框架作业, 而不需要每次都重新优化分布式计算框架参数, 实 现分布式计算框架作业参数配置合理化、 自动化以及自学习。
作为本发明的一个优选实施例, 在预先建立的分布式计算框架历史运 行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框架 作业, 包括:
检查所述分布式计算框架作业是否存在指定的分布式计算框架运行 参数;
当所述分布式计算框架作业不存在指定的分布式计算框架运行参数 时, 执行所述在分布式计算框架历史作业运行数据库中, 检索与所述分布 式计算框架作业同类的历史分布式计算框架作业的步骤。
在本实施例中, 当提交任务时, 系统获取分布式计算框架作业中的参 表文件, 通过参表文件检查是否存在指定的分布式计算框架运行参数。
作为本发明的一个优选实施例, 根据相似的历史分布式计算框架作业 的配置参数, 对所述分布式计算框架作业的配置参数进行优化配置, 也可 以在相似的历史分布式计算框架作业中, 获取评分大于预设阀值的多个分 布式计算框架作业, 按照多个分布式计算框架作业的相似程度, 加权计算 多个分布式计算框架作业的配置参数, 使用加权计算得到的配置参数作为 所述分布式计算框架作业的配置参数, 对所述分布式计算框架作业的配置 参数进行优化配置。 例如对于新作业 Job— A, 其参数设置可以基于以下 K 个最相似的作业 A计算得:
其中 为新作业 Job— A的某一个配置参数, K为选出的评分大于某个 阔值的作业个数, A表示这些作业中的第 7'个作业。 总的来说新作业参数 可以基于 TopK个评分最高的作业按照相似度加权计算产生, 由于综合了 多个分布式计算框架作业参数配置, 这样可以使新作业的参数优化模型更 稳定。
参考图 2 , 图 2是本发明实施例提供的保存分布式计算框架作业的实 施流程图, 详述如下:
S201 , 当所述分布式计算框架作业执行完毕时, 收集所述分布式计算 框架作业执行信息及配置参数;
S202 , 对所述分布式计算框架作业执行信息进行评分, 并将所述分布 式计算框架作业保存到所述分布式计算框架历史作业数据库中。
作为本发明的一个优选实施例, 收集所述分布式计算框架作业执行 信息及配置参数, 包括: 收集所述分布式计算框架作业的当前集群环境信息以及作业配置参 数信息。
在本实施例中, 集群环境信息包括但不限于计算节点数、 内存总量、 cpu总量、 dfs块大小, dfs副本数, 网络带宽, 磁盘 10。
在本实施例中, 作业配置参数包括但不限于 Mapper类、 Reducer类、 对应字节数、 输入输出文件格式、 对应路径、 split信息。 在本实施例中, 收集所述分布式计算框架作业的当前集群环境信息 以及作业配置参数信息, 主要用于后续分布式计算框架作业的相似度计 算。
作为本发明的一个优选实施例, 所述对分布式计算框架作业的执行 信息进行评分, 包括:
获取所述分布式计算框架作业运行的时间消耗和空间消耗; 根据所述分布式计算框架作业运行的时间消耗和空间消耗, 生成所 述分布式计算框架作业运行的时间消耗代价和空间消耗代价;
根据预先建立的分布式计算框架作业的评分模型, 以及所述分布式 计算框架作业运行的时间消耗代价和空间消耗代价对分布式计算框架作 业运行进行评分。
在本实施例中, 时间消耗为代价属性的时间消耗。
参考表 1 , 表 1是本发明实施例提供的较佳的时间消耗代价属性表, 其 包括了部分计算时间消耗的代价属性名。 表 -1时间消耗代价属性表
代价属性名 代价所属阶段 代价属性描述
HdfsReadCo 全局
每字节 HDFS读耗时
St
HdfsWriteC 全局
每字节 HDFS写耗时 ost
LocallORea 全局
每字节本地读耗时
dCost LocallOWrit 全局
每字节本地写耗时 eCost
NetworkTra 全局
每字节网络传输耗时 nsCost
SetupCPUC 全局
启动一个 task的 CPU时间消耗 ost
CleanupCP 全局
清理一个 task的 CPU时间消耗 UCost
MapCPUCo Map处理阶段 一个 Map Task处理一条记录的 stPerRec CPU 时间消耗
MapGCCost Map处理阶段 一个 Map Task处理一条记录的 PerRec GC时间消耗
MapInputCP Map处理阶段 Ma 输入阶段读取单字节的 UCost CPU时间消耗
MapOutput Map处理阶段 Ma 输出阶段写出单字节的 CPUCos CPU时间消耗
CombineCP Shuffle阶段 Combiner合并一条记录的 CPU UCost 时间消耗
PartitionCP Shuffle阶段 一条记录的 Partition 的 CPU时 UCost 间消耗
SerdeCPUC Shuffle阶段 一条记录的序列化和反序列化 ost 的 CPU时间消耗
SortCPUCos Shuffle阶段
排序一条记录的 CPU时间消耗 t
MergeCPUC Shuffle阶段
Merge一条记录的 CPU时间消耗 ost
ReduceCPU Reduce处理 一个 Reduce Task处理一条记录 CostPerRec 阶段 的 CPU 时间消耗
ReduceGCC Reduce处理 一个 Reduce Task处理一条记录 ostPerRec 阶段 的 GC时间消耗
Reducelnput Reduce处理 Reduce输入阶段解压单字节的 CPUCost 阶段 CPU时间消耗
ReduceOutp Reduce处理 Reduce输出阶段压缩单字节的 utCPUCost 阶段 CPU时间消耗
注: 具体实施中可以不局限于上述属性字段。 在本实施例中, 根据分布式计算框架作业运行的时间消耗生成分布式 计算框架作业运行的时间消耗代价。 可通过, 每个阶段时间消耗, 以及输 入输出的数据量计算获得。 例如, 时间消耗代价属性表中 HdfsReadCost, 其时间消耗代价每字节 HDFS的读耗时, 可通过字节读取数量除以字节读 取的总时间,生成 HdfsReadCost时间消耗代价(每字节 HDFS的读耗时)。
在本实施例中, 空间消耗为代价属性的空间消耗。
参考表 2 , 表 2是本发明实施例提供的较佳的空间消耗代价属性表, 其 包括了部分计算空间消耗的代价属性名。 表 -2空间消耗代价属性表
Figure imgf000017_0001
注: 具体实施中可以不局限于上述属性字段。 在本实施例中, 根据分布式计算框架作业运行的空间消耗生成分布式 计算框架作业运行的空间消耗代价。 可通过每个阶段空间消耗, 以及输入 输出的数据量计算获得。 例如 , 代价属性名 MapAvgMemBytes , 其空间消耗代价为 Map阶段平均 每字节对内存资源消耗, 由平均内存消耗除以输入的记录条数生成, 具体 计算公式如下:
MapAvgMem
MapAvgMemBytes= ~
MapInputBytes
其中 MapAvgMem为平均内存消耗, MapInputBytes为输入的记录条数,
MapAvgMem和 MapInputBytes可以通过分布式计算框架的 Metrics直接获 取。
此外, 代价属性名 MapCPUCostPeiBytes , 其空间消耗代价为 Map阶段每 个字节的的平均 C P U消耗,由 M A P阶段 CPU内存总消耗除以输入的记 录条数生成, 具体计算公式如下:
MapCPUCostPerBytes = MapCPUC°St
MapInputBytes
其中 MapCPUCost和 MapInputBytes字段可以通过分布式计算框架的
Metrics直接获取。
作为本发明的一个优选实施例, 在所述根据预先建立的分布式计算框 架作业的评分模型, 以及所述分布式计算框架作业运行的时间消耗代价和 空间消耗代价对分布式计算框架作业运行进行评分之前, 包括:
建立评分模型;
所述评分模型为
其中, 。¾(τ,υ)表示一个作业运行时的评分, 分别表示对应的时间 消耗代价、 空间消耗代价, 作业执行评分时^ ^的函数。 是时间消耗 代价评分和空间消耗代价评分的权重, i为时间消耗代价的中属性值的序 号, 对应于时间消耗代价的第 个属性值, j为空间消耗代价的中属性值 的序号, ";表示对应于空间消耗代价的第 ·/'个属性值, ^则分别对应 上述两个属性的权重, 其中参数", 用于可以调节设置时间消耗代价和 空间消耗代价哪个更优先; , 的目的是为了消除各代价属性值量级 不同的差异, 通过设置 ^来规范化的计算 ¾(τ,υ)。
作为本发明的一个优选实施例, 将所述分布式计算框架作业保存到所 述分布式计算框架历史作业数据库中, 具体为:
釆用树形存储方式, 将所述分布式计算框架作业保存到所述分布式计 算框架历史作业数据库中。
在本实施例中, 釆用树形存储方式, 以树根到树叶子节点的路径表示 了对应的作业的类名称, 将所述分布式计算框架作业保存到所述分布式计 算框架历史作业数据库中。
参考图 3 ,图 3是本发明实施例提供的树形存储分布式计算框架作业的 较佳的样例图。
在本实施例中, 在本实施例中, 相同类名的作业存放在同一个叶子节 点中 (如图中的虚线框) , 以便于后续在搜索同类的分布式计算框架作业 时, 可以快速搜索出同类的分布式计算框架作业。
作为本发明的一个优选实施例, 在预先建立的分布式计算框架历史 运行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框 架作业, 包括:
在预先建立的分布式计算框架历史运行数据库中, 釆用搜索树节点 方式, 检索釆用树形存储的与所述分布式计算框架作业同类的分布式计算 框架作业。
在本实施例中, 釆用搜索树节点方式, 检索釆用树形存储的与所述 分布式计算框架作业同类的分布式计算框架作业。 例如参考图 5 , 对于 com.huawei.pagerank.PageRank-1的作业, 通过才艮节点
root->com->huawei->pagerank , 共 3次查找即可获取与所述分布式计算框 架作业同类的分布式计算框架作业。 作为本发明的一个优选实施例, 所述检索与所述分布式计算框架作 业相似的历史分布式计算框架作业, 包括:
获取所述分布式计算框架作业和历史分布式计算框架作业的属性字 段, 所述属性字段包括关键属性集合和非关键属性集合;
根据预先建立的分布式计算框架作业的相似度模型以及所述属性字 段, 分别生成作业的相似度和集群环境信息的相似度, 所述作业的相似度 为所述分布式计算框架作业与历史分布式计算框架作业的相似度, 所述集 群环境信息的相似度为所述分布式计算框架作业与历史分布式计算框架 作业的相似度分别在所述集群环境信息的相似度;
根据预先建立的分布式计算框架作业的综合相似度模型以及加权策 略, 生成所述分布式计算框架作业与历史分布式计算框架作业的综合相似 度。
在本实施例中, 参考表 3 , 表 3是本发明实施例提供的较佳的属性字 段表, 其包括部分分布式计算框架作业相似度计算时使用的字段。
表 -3 Job任务属性表
Figure imgf000020_0001
是否有 Split 布尔型 否 是否有输入路径
Split信息 字符串 否 Map任务对应输入 文件信息
JVM-OPTS 字符串 否 Task对应的 jvm opt 选项 注: 具体实施中可以不局限于上述属性字段。 在本实施例中, 参考表 4 , 表 4是本发明实施例提供的较佳集群环境 的属性字段表, 其包括部分分布式计算框架作业相似度计算时使用的字 段。
表 -4集群环境参数相似度
Figure imgf000021_0001
注: 具体实施中可以不局限于上述属性字段。 作为本发明的一个优选实施例, 在所述根据预先建立的分布式计算 框架作业的相似度模型以及所述属性字段, 分别生成作业的相似度和集群 环境信息的相似度之前, 包括: 建立分布式计算框架作业的相似度模型,
所述相似度模型为:
Figure imgf000022_0001
其中 Κ为关键属性集合, k为关键属性集合的中关键属性的序号, I 为非关键属性集合, i为非关键属性集合的中非关键属性的序号 , 表示作 业 Α的第 k个关键属性, 为标识作业 A的第 i个非关键属性, ; 为标 识作业 B的第 k个关键属性, 为标识作业 B的第 i个非关键属性。
需要进行说明的是, 对于关键属性, 是基于绝对相等模式, 一旦关键 属性中存在不相等, 则直接返回相似度为 0,也就是分布式计算框架作业与 历史分布式计算框架作业不相似。
作为本发明的一个优选实施例, 在根据预先建立的分布式计算框架作 业的综合相似度模型以及加权策略, 生成所述分布式计算框架作业与历史 分布式计算框架作业的综合相似度之前, 包括:
建立分布式计算框架作业的综合相似度模型,
所述综合相似度模型为:
sim(A,B.) = x im(JobA, JobE) + β x sim(C luster A, ClusterE)
其中 sim(JobA, JobE)表示作业 , 的相似度, sim(ClusterA, ClusterE)表示作业
A 分别在所述集群环境信息的相似度。 w^O S)表示作业 AS之间参考了 集群环境信息的相似度, "为加权策略中的第一权重参数, 为加权策略 中的第二权重参数。
在本实施例中, 作业之间的相似度基于上述公式得到, 参数说明与上 面描述一致。
Figure imgf000022_0002
度计算可以简化为: sim(ClusterA, ClusterB) -
Figure imgf000023_0001
其中 /为集群参数集合, 为标识集群 A的第 i个属性值, 为标识 作业 B的第 j个属性值, 即是一个简单的基于余弦相似度的计算模型。
作为本发明的一个优选实施例, 图 4是本实施例提供的分布式计算框 架参数优化的较佳的实施流程图, 详述如下:
5401, 获取当前提交的并行计算框架 (分布式计算框架, 分布式计算 框架)作业;
5402, 判断所述分布式计算框架作业用户是否自定义分布式计算框架 参数, 是则 S 403, 否则执行 S 404;
S 403, 按照用户指定参数提交分布式计算框架作业;
S404, 从历史运行库中检索相似作业;
S 405, 是否存在同类型作业, 是则执行 S 405, 否则执行 S 406;
S 406, 使用默认值提交分布式计算框架作业;
S 407, 选择一个评分最高的分布式计算框架作业;
S 408, 按照最优参数提交分布式计算框架作业;
S 409, 分布式计算框架作业运行结束, 收集分布式计算框架配置和运 行曰志;
S 409, 对当前分布式计算框架作业评分, 将结果放入数据库。
参考图 5, 图 5是本发明实施例提供的一种参数优化装置的结构示意 图, 为了便于说明, 仅示出了与本实施例相关的部分, 详述如下:
获取单元 51, 用于获取当前提交的分布式计算框架作业; 第一检索单元 52 , 用于在预先建立的分布式计算框架历史运行数据库 中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业, 所 述分布式计算框架历史运行数据库包括历史分布式计算框架作业的执行 信息及配置参数;
第二检索单元 53 , 用于在同类的分布式计算框架作业中, 检索与所述 分布式计算框架作业相似的历史分布式计算框架作业;
配置单元 54 , 用于根据相似的历史分布式计算框架作业的配置参数, 对所述分布式计算框架作业的配置参数进行优化配置。
进一步地, 在该装置中, 所述第一检索单元, 包括:
检查子单元, 用于检查所述分布式计算框架作业是否存在指定的分布 式计算框架运行参数;
执行子单元, 用于当所述分布式计算框架作业不存在指定的分布式计 算框架运行参数时, 执行所述在分布式计算框架历史作业运行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业的步骤。
进一步地, 在该装置中, 所述配置单元, 还用于在相似的历史分布式 计算框架作业中, 获取评分最高的历史分布式计算框架作业, 使用评分最 高的历史分布式计算框架作业的配置参数作为所述分布式计算框架作业 的配置参数, 对所述分布式计算框架作业的配置参数进行优化配置。
进一步地, 在该装置中, 还包括:
收集单元, 用于当所述分布式计算框架作业执行完毕时, 收集所述分 布式计算框架作业执行信息及配置参数;
评分单元, 用于对所述分布式计算框架作业执行信息进行评分, 并将 所述分布式计算框架作业保存到所述分布式计算框架历史作业数据库中。
进一步地, 在该装置中, 所述评分单元, 包括:
获取子单元, 用于获取所述分布式计算框架作业运行的时间消耗和空 间消耗; 生成子单元, 用于根据所述分布式计算框架作业运行的时间消耗和空 间消耗, 生成所述分布式计算框架作业运行的时间消耗代价和空间消耗代 价;
评分子单元, 用于根据预先建立的分布式计算框架作业的评分模型, 以及所述分布式计算框架作业运行的时间消耗代价和空间消耗代价对分 布式计算框架作业运行进行评分。
进一步地, 在该装置中, 所述评分单元, 还包括:
建立子单元, 用于建立评分模型;
所述评分模型为
FJob(r,v) = d *ωι) + β(^υ]}) 其中, 。¾(τ, υ)表示一个作业运行时的评分, 分别表示对应的时间 消耗代价、 空间消耗代价, 作业执行评分时^ ^的函数。 是时间消耗 代价评分和空间消耗代价评分的权重, i为时间消耗代价的中属性值的序 号, 对应于时间消耗代价的第 个属性值, j为空间消耗代价的中属性值 的序号, ";表示对应于空间消耗代价的第 '个属性值, , ^则分别对应 上述两个属性的权重, 其中参数 用于可以调节设置时间消耗代价和 空间消耗代价哪个更优先; ^ , ^的目的是为了消除各代价属性值量级 不同的差异, 通过设置^ , ^来规范化的计算 ¾( , )。
进一步地, 在该装置中, 所述评分单元, 还包括:
保存子单元, 用于釆用树形存储方式, 将所述分布式计算框架作业保 存到所述分布式计算框架历史作业数据库中。
进一步地, 在该装置中, 第一检索单元, 包括:
第一检索子单元, 用于在预先建立的分布式计算框架历史运行数据库 中, 釆用搜索树节点方式, 检索与所述分布式计算框架作业同类的历史分 布式计算框架作业。 进一步地, 在该装置中, 第二检索单元, 包括:
第二检索子单元, 用于检索所述分布式计算框架作业与历史分布式计 算框架作业中的关键属性是否相等;
相似子单元, 用于当所述分布式计算框架作业中的关键属性与历史分 布式计算框架作业中的关键属性相等时, 表示所述历史分布式计算框架作 业为与所述分布式计算框架作业相似的历史分布式计算框架作业。
进一步地, 在该装置中, 第二检索单元, 还包括:
获取子单元, 用于获取所述分布式计算框架作业和历史分布式计算框 架作业的属性字段, 所述属性字段包括关键属性集合和非关键属性集合; 第一生成子单元, 用于根据预先建立的分布式计算框架作业的相似度 模型以及所述属性字段, 分别生成作业的相似度和集群环境信息的相似 度, 所述作业的相似度为所述分布式计算框架作业与历史分布式计算框架 作业的相似度, 所述集群环境信息的相似度为所述分布式计算框架作业与 历史分布式计算框架作业的相似度分别在所述集群环境信息的相似度; 第二生成子单元, 用于根据预先建立的分布式计算框架作业的综合相 似度模型以及加权策略, 生成所述分布式计算框架作业与历史分布式计算 框架作业的综合相似度。
进一步地, 在该装置中, 第一生成子单元, 还包括:
第一建立子单元, 用于建立分布式计算框架作业的相似度模型, 所述相似度模型为:
Figure imgf000026_0001
其中 K为关键属性集合, k为关键属性集合的中关键属性的序号, I 为非关键属性集合, i为非关键属性集合的中非关键属性的序号 , 表示作 业 A的第 k个关键属性, 为标识作业 A的第 i个非关键属性, ; 为标 识作业 B的第 k个关键属性, 为标识作业 B的第 i个非关键属性。
进一步地, 在该装置中, 第二生成子单元, 还包括:
第二建立子单元, 用于建立分布式计算框架作业的综合相似度模型, 所述综合相似度模型为:
sim(A,B) = x sim(JobA, JobB) + β x sim(C luster A, Cluster B)
其中 s JobA, JobB)表示作业 A 的相似度, sim(ClusterA, ClusterB)表示作业
A 分别在所述集群环境信息的相似度。 w^O S)表示作业 AS之间参考了 集群环境信息的相似度, "为加权策略中的第一权重参数, 为加权策略 中的第二权重参数。
作为本发明的一个优选实施例, 一种分布式计算框架参数优化系统, 参数优化装置、 提交的分布式计算框架作业的客户端以及计算管理节点, 其中, 所述分布式计算框架作业的客户端与所述计算管理节点之间, 通过 所述参数优化装置进行连接。
参考图 6 ,图 6是本实施例提供的分布式计算框架参数优化系统较佳的 网络架构图。
其中, 参数自动优化配置模块处于分布式计算框架作业提交客户端和 分布式计算框架 Master之间。 当用户通过分布式计算框架客户端提交任 务时, 参数优化配置模块会对该任务进行一系列自动化的参数配置, 然后 提交到分布式计算框架的计算管理节点 Master上, 再由 Master将该分布 式计算框架作业分配给所管辖的多个 Worker节点上执行任务。
其中, 分布式计算框架历史任务运行库存放了集群上已经运行完成的 分布式计算框架作业信息, 其存放形式可以在本地、 HDFS或者数据库中, 供参数优化配置模块检索相似任务时使用。 参考图 7 , 图 7是本发明实施例提供的一种参数优化装置的结构示意 图, 本发明具体实施例并不对所述参数优化装置的具体实现做限定, 所述 参数优化装置 700 , 包括:
处理器 (英文: rocessor)701 , 通信接口 (英文: Communications Interface)702 , 存储器(英文: memory)103 , 总线 704。
处理器 701 , 通信接口 702 , 存储器 703通过总线 704完成相互间的 通信。
通信接口 702 , 用于与其他通信设备进行通信;
处理器 701 , 用于执行程序。
具体地,程序可以包括程序代码,所述程序代码包括计算机操作指令。 处理器 701可能是一个中央处理器(英文: central processing unit, 缩 写: CPU。
存储器 703 , 用于存储程序。 其中程序用于获取当前提交的并行计算 框架 (分布式计算框架, 分布式计算框架)作业, 检查所述分布式计算 框架作业是否存在指定的分布式计算框架运行参数;
用于当所述分布式计算框架作业不存在指定的分布式计算框架运行 参数时, 在预先建立的分布式计算框架历史运行数据库中, 检索与所述分 布式计算框架作业同类的历史分布式计算框架作业, 所述分布式计算框架 历史运行数据库包括历史分布式计算框架作业的执行信息及配置参数; 用 于在同类的分布式计算框架作业中, 检索与所述分布式计算框架作业相似 的历史分布式计算框架作业; 用于根据相似的历史分布式计算框架作业的 配置参数, 对所述分布式计算框架作业的配置参数进行优化配置。
以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在 本发明的精神和原则之内所作的任何修改、 等同替换和改进等, 均应包含 在本发明的保护范围之内。

Claims

权利 要求 书
1、 一种分布式计算框架参数优化的方法, 其特征在于, 包括: 获取当前提交的分布式计算框架作业;
在分布式计算框架历史作业运行数据库中, 检索与所述分布式计算框 架作业同类的历史分布式计算框架作业, 所述分布式计算框架历史作业运 行数据库包括历史分布式计算框架作业的执行信息及配置参数;
在同类的分布式计算框架作业中, 检索与所述分布式计算框架作业相 似的历史分布式计算框架作业;
根据相似的历史分布式计算框架作业的配置参数, 对所述分布式计算 框架作业的配置参数进行优化配置。
2、 如权利要求 1所述的方法, 其特征在于, 所述在分布式计算框架 历史作业运行数据库中, 检索与所述分布式计算框架作业同类的历史分布 式计算框架作业之前, 所述方法还包括:
检查所述分布式计算框架作业是否存在指定的分布式计算框架运行 参数;
当所述分布式计算框架作业不存在指定的分布式计算框架运行参数 时, 执行所述在分布式计算框架历史作业运行数据库中, 检索与所述分布 式计算框架作业同类的历史分布式计算框架作业的步骤。
3、 如权利要求 1所述的方法, 其特征在于, 所述根据相似的历史分 布式计算框架作业的配置参数, 对所述分布式计算框架作业的配置参数进 行优化配置, 包括:
在相似的历史分布式计算框架作业中, 获取评分最高的历史分布式计 算框架作业, 使用评分最高的历史分布式计算框架作业的配置参数作为所 述分布式计算框架作业的配置参数, 对所述分布式计算框架作业的配置参 数进行优化配置; 或
在相似的历史分布式计算框架作业中, 获取评分大于预设阀值的多个 分布式计算框架作业, 按照多个分布式计算框架作业的相似程度, 加权计 算多个分布式计算框架作业的配置参数, 使用加权计算得到的配置参数作 为所述分布式计算框架作业的配置参数, 对所述分布式计算框架作业的配 置参数进行优化配置。
4、 如权利要求 1所述的方法, 其特征在于, 还包括:
当所述分布式计算框架作业执行完毕时, 收集所述分布式计算框架作 业执行信息及配置参数;
对所述分布式计算框架作业执行信息进行评分, 并将所述分布式计算 框架作业保存到所述分布式计算框架历史作业数据库中。
5、 如权利要求 4所述的方法, 其特征在于, 对所述分布式计算框架 作业执行信息进行评分, 具体为:
获取所述分布式计算框架作业运行的时间消耗和空间消耗;
根据所述分布式计算框架作业运行的时间消耗和空间消耗, 生成所述 分布式计算框架作业运行的时间消耗代价和空间消耗代价;
根据预先建立的分布式计算框架作业的评分模型, 以及所述分布式计 算框架作业运行的时间消耗代价和空间消耗代价对分布式计算框架作业 运行进行评分。
6、 如权利要求 4所述的方法, 其特征在于, 在所述根据预先建立的 分布式计算框架作业的评分模型, 以及所述分布式计算框架作业运行的时 间消耗代价和空间消耗代价对分布式计算框架作业运行进行评分之前, 包 括:
建立评分模型;
所述评分模型为
其中, 。¾(τ,υ)表示一个作业运行时的评分, 分别表示对应的时间 消耗代价、 空间消耗代价, 作业执行评分时^ ^的函数。 是时间消耗 代价评分和空间消耗代价评分的权重, i为时间消耗代价的中属性值的序 号, ^对应于时间消耗代价的第 个属性值, j为空间消耗代价的中属性值 的序号, ";表示对应于空间消耗代价的第 ·/'个属性值, ^则分别对应 上述两个属性的权重, 其中参数", 用于可以调节设置时间消耗代价和 空间消耗代价哪个更优先; ^ , ^的目的是为了消除各代价属性值量级 不同的差异, 通过设置^ , ^来规范化的计算 ¾( , )。
7、 如权利要求 4所述的方法, 其特征在于, 所述将所述分布式计算 框架作业保存到所述分布式计算框架历史作业数据库中, 具体为:
釆用树形存储方式, 将所述分布式计算框架作业保存到所述分布式 计算框架历史作业数据库中。
8、 如权利要求 1所述的方法, 其特征在于, 在预先建立的分布式计 算框架历史运行数据库中, 检索与所述分布式计算框架作业同类的历史分 布式计算框架作业, 包括:
在预先建立的分布式计算框架历史运行数据库中, 釆用搜索树节点 方式, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业。
9、 如权利要求 1所述的方法, 其特征在于, 所述检索与所述分布式 计算框架作业相似的历史分布式计算框架作业, 包括:
检索所述分布式计算框架作业与历史分布式计算框架作业中的关键 属性是否相等;
当所述分布式计算框架作业中的关键属性与历史分布式计算框架作 业中的关键属性相等时, 表示所述历史分布式计算框架作业为与所述分布 式计算框架作业相似的历史分布式计算框架作业。
10、 如权利要求 9所述的方法, 其特征在于, 所述检索与所述分布 式计算框架作业相似的历史分布式计算框架作业, 还包括:
获取所述分布式计算框架作业和历史分布式计算框架作业的属性字 段, 所述属性字段包括关键属性集合和非关键属性集合; 根据预先建立的分布式计算框架作业的相似度模型以及所述属性字 段, 分别生成作业的相似度和集群环境信息的相似度, 所述作业的相似度 为所述分布式计算框架作业与历史分布式计算框架作业的相似度, 所述集 群环境信息的相似度为所述分布式计算框架作业与历史分布式计算框架 作业的相似度分别在所述集群环境信息的相似度;
根据预先建立的分布式计算框架作业的综合相似度模型以及加权策 略, 生成所述分布式计算框架作业与历史分布式计算框架作业的综合相似 度。
1 1、 如权利要求 10所述的方法, 其特征在于, 在所述根据预先建立 的分布式计算框架作业的相似度模型以及所述属性字段, 分别生成作业的 相似度和集群环境信息的相似度之前, 包括:
建立分布式计算框架作业的相似度模型,
所述相似度模型为:
Figure imgf000032_0001
其中 K为关键属性集合, k为关键属性集合的中关键属性的序号, I 为非关键属性集合, i为非关键属性集合的中非关键属性的序号 , 表示作 业 Α的第 k个关键属性, 为标识作业 A的第 i个非关键属性, ; 为标 识作业 B的第 k个关键属性, 为标识作业 B的第 i个非关键属性。
12、 如权利要求 10所述的方法, 其特征在于, 在根据预先建立的分 布式计算框架作业的综合相似度模型以及加权策略, 生成所述分布式计算 框架作业与历史分布式计算框架作业的综合相似度之前, 包括:
建立分布式计算框架作业的综合相似度模型,
所述综合相似度模型为:
sim(A,B) = x im(JobA, JobE) + β x sim(C luster A, Cluster E) 其中 sim(JobA, JobE)表示作业 , 的相似度, sim(ClusterA, ClusterE)表示作 业 AS分别在所述集群环境信息的相似度, w^O s)表示作业 AS之间参考 了集群环境信息的相似度, "为加权策略中的第一权重参数, /^为加权策 略中的第二权重参数。
13、 一种分布式计算框架参数优化装置, 其特征在于, 包括: 获取单元, 用于获取当前提交的分布式计算框架作业;
第一检索单元, 在预先建立的分布式计算框架历史运行数据库中, 检 索与所述分布式计算框架作业同类的历史分布式计算框架作业, 所述分布 式计算框架历史运行数据库包括历史分布式计算框架作业的执行信息及 配置参数;
第二检索单元, 用于在同类的分布式计算框架作业中, 检索与所述分 布式计算框架作业相似的历史分布式计算框架作业;
配置单元, 用于根据相似的历史分布式计算框架作业的配置参数, 对 所述分布式计算框架作业的配置参数进行优化配置。
14、 如权利要求 13所述的参数优化装置, 其特征在于, 所述第一检 索单元, 包括:
检查子单元, 用于检查所述分布式计算框架作业是否存在指定的分布 式计算框架运行参数;
执行子单元, 用于当所述分布式计算框架作业不存在指定的分布式计 算框架运行参数时, 执行所述在分布式计算框架历史作业运行数据库中, 检索与所述分布式计算框架作业同类的历史分布式计算框架作业的步骤。
15、 如权利要求 13所述的参数优化装置, 其特征在于, 所述配置单 元, 还用于在相似的历史分布式计算框架作业中, 获取评分最高的历史分 布式计算框架作业, 使用评分最高的历史分布式计算框架作业的配置参数 作为所述分布式计算框架作业的配置参数, 对所述分布式计算框架作业的 配置参数进行优化配置或 在相似的历史分布式计算框架作业中, 获取评分大于预设阀值的多 个分布式计算框架作业, 按照多个分布式计算框架作业的相似程度, 加权 计算多个分布式计算框架作业的配置参数, 使用加权计算得到的配置参数 作为所述分布式计算框架作业的配置参数, 对所述分布式计算框架作业的 配置参数进行优化配置。
16、 如权利要求 13所述的参数优化装置, 其特征在于, 还包括: 收集单元, 用于当所述分布式计算框架作业执行完毕时, 收集所述分 布式计算框架作业执行信息及配置参数;
评分单元, 用于对所述分布式计算框架作业执行信息进行评分, 并将 所述分布式计算框架作业保存到所述分布式计算框架历史作业数据库中。
17、 如权利要求 16所述的参数优化装置, 其特征在于, 所述评分单 元, 包括:
获取子单元, 用于获取所述分布式计算框架作业运行的时间消耗和空 间消耗;
生成子单元, 用于根据所述分布式计算框架作业运行的时间消耗和空 间消耗, 生成所述分布式计算框架作业运行的时间消耗代价和空间消耗代 价;
评分子单元, 用于根据预先建立的分布式计算框架作业的评分模型, 以及所述分布式计算框架作业运行的时间消耗代价和空间消耗代价对分 布式计算框架作业运行进行评分。
18、 如权利要求 16所述的参数优化装置, 其特征在于, 所述评分单 元, 还包括:
建立子单元, 用于建立评分模型;
所述评分模型为 其中, 。¾(τ, υ)表示一个作业运行时的评分, 分别表示对应的时间 消耗代价、 空间消耗代价, 作业执行评分时^ ^的函数。 是时间消耗 代价评分和空间消耗代价评分的权重, i为时间消耗代价的中属性值的序 号, 对应于时间消耗代价的第 个属性值, j为空间消耗代价的中属性值 的序号, ";表示对应于空间消耗代价的第 '个属性值, , ^则分别对应 上述两个属性的权重, 其中参数 用于可以调节设置时间消耗代价和 空间消耗代价哪个更优先; ^ , ^的目的是为了消除各代价属性值量级 不同的差异, 通过设置^ , ^来规范化的计算 ¾( , )。
19、 如权利要求 16所述的参数优化装置, 其特征在于, 所述评分单 元, 还包括:
保存子单元, 用于釆用树形存储方式, 将所述分布式计算框架作业 保存到所述分布式计算框架历史作业数据库中。
20、 如权利要求 13所述的参数优化装置, 其特征在于, 所述第一检 索单元, 包括:
第一检索子单元, 用于在预先建立的分布式计算框架历史运行数据 库中, 釆用搜索树节点方式, 检索与所述分布式计算框架作业同类的历史 分布式计算框架作业。
21、 如权利要求 13所述的的参数优化装置, 其特征在于, 所述第二 检索单元, 包括:
第二检索子单元, 用于检索所述分布式计算框架作业与历史分布式 计算框架作业中的关键属性是否相等;
相似子单元, 用于当所述分布式计算框架作业中的关键属性与历史 分布式计算框架作业中的关键属性相等时, 表示所述历史分布式计算框架 作业为与所述分布式计算框架作业相似的历史分布式计算框架作业。
22、 如权利要求 21所述的参数优化装置, 其特征在于, 所述第二检 索单元, 还包括: 获取子单元, 用于获取所述分布式计算框架作业和历史分布式计算 框架作业的属性字段, 所述属性字段包括关键属性集合和非关键属性集 合;
第一生成子单元, 用于根据预先建立的分布式计算框架作业的相似 度模型以及所述属性字段, 分别生成作业的相似度和集群环境信息的相似 度, 所述作业的相似度为所述分布式计算框架作业与历史分布式计算框架 作业的相似度, 所述集群环境信息的相似度为所述分布式计算框架作业与 历史分布式计算框架作业的相似度分别在所述集群环境信息的相似度; 第二生成子单元, 用于根据预先建立的分布式计算框架作业的综合 相似度模型以及加权策略, 生成所述分布式计算框架作业与历史分布式计 算框架作业的综合相似度。
23、 如权利要求 22所述的参数优化装置, 其特征在于, 所述第一生 成子单元, 还包括:
第一建立子单元, 用于建立分布式计算框架作业的相似度模型, 所述相似度模型为:
Figure imgf000036_0001
其中 K为关键属性集合, k为关键属性集合的中关键属性的序号, I 为非关键属性集合, i为非关键属性集合的中非关键属性的序号 , 表示作 业 Α的第 k个关键属性, 为标识作业 A的第 i个非关键属性, ; 为标 识作业 B的第 k个关键属性, 为标识作业 B的第 i个非关键属性。
24、 如权利要求 22所述的参数优化装置, 其特征在于, 所述第二生 成子单元, 还包括:
第二建立子单元, 用于建立分布式计算框架作业的综合相似度模型, 所述综合相似度模型为: sim(A,B.) = x im(JobA, JobE) + β x sim(C luster A, Cluster E)
其中 sim(JobA, JobE)表示作业 , 的相似度, sim(ClusterA, ClusterE)表示作 业 AS分别在所述集群环境信息的相似度。 w^O s)表示作业 AS之间参考 了集群环境信息的相似度, "为加权策略中的第一权重参数, /^为加权策 略中的第二权重参数。
25、 一种分布式计算框架参数优化系统, 其特征在于, 包括权利要求 13至 24任意一项所述的参数优化装置、 提交的分布式计算框架作业的客 户端以及计算管理节点, 其中, 所述分布式计算框架作业的客户端与所述 计算管理节点之间, 通过所述参数优化装置进行连接。
PCT/CN2014/084483 2013-10-21 2014-08-15 一种分布式计算框架参数优化方法、装置及系统 WO2015058578A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310495879.7 2013-10-21
CN201310495879.7A CN103605662B (zh) 2013-10-21 2013-10-21 一种分布式计算框架参数优化方法、装置及系统

Publications (1)

Publication Number Publication Date
WO2015058578A1 true WO2015058578A1 (zh) 2015-04-30

Family

ID=50123887

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/084483 WO2015058578A1 (zh) 2013-10-21 2014-08-15 一种分布式计算框架参数优化方法、装置及系统

Country Status (2)

Country Link
CN (1) CN103605662B (zh)
WO (1) WO2015058578A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710395A (zh) * 2017-10-26 2019-05-03 中国电信股份有限公司 参数优化控制方法、装置和分布式计算系统

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605662B (zh) * 2013-10-21 2017-02-22 华为技术有限公司 一种分布式计算框架参数优化方法、装置及系统
CN105302536A (zh) * 2014-07-31 2016-02-03 国际商业机器公司 MapReduce应用的相关参数的配置方法和装置
CN105511957B (zh) 2014-09-25 2019-05-07 国际商业机器公司 用于生成作业告警的方法和系统
CN104462216B (zh) * 2014-11-06 2018-01-26 上海南洋万邦软件技术有限公司 居委标准代码转换系统及方法
WO2016127410A1 (zh) * 2015-02-13 2016-08-18 华为技术有限公司 一种应用属性参数的配置方法、装置及终端
CN106021495B (zh) * 2016-05-20 2017-10-31 清华大学 一种分布式迭代计算系统的任务参数优化方法
CN106383746A (zh) * 2016-08-30 2017-02-08 北京航空航天大学 大数据处理系统的配置参数确定方法和装置
CN108733750A (zh) * 2018-04-04 2018-11-02 安徽水利开发股份有限公司 一种数据库优化方法
CN110554910A (zh) * 2018-05-30 2019-12-10 中国电信股份有限公司 优化分布式计算效能的方法和装置
CN109614236B (zh) * 2018-12-07 2023-04-18 深圳前海微众银行股份有限公司 集群资源动态调整方法、装置、设备及可读存储介质
CN110609850A (zh) * 2019-08-01 2019-12-24 联想(北京)有限公司 一种信息确定方法、电子设备及计算机存储介质
CN110908803B (zh) * 2019-11-22 2022-07-05 神州数码融信软件有限公司 一种基于余弦相似度算法的作业分配方法
CN112540849B (zh) 2020-12-11 2022-07-26 清华大学 一种分布式计算作业的参数配置优化方法及系统
CN113552856B (zh) * 2021-09-22 2021-12-10 成都数之联科技有限公司 工艺参数根因定位方法和相关装置
CN113688602A (zh) * 2021-10-26 2021-11-23 中电云数智科技有限公司 一种任务处理方法以及装置
CN116225635A (zh) * 2021-12-06 2023-06-06 中兴通讯股份有限公司 任务优化方法、装置和计算机可读存储介质
CN117269180B (zh) * 2023-11-24 2024-03-12 成都数之联科技股份有限公司 车辆外观检测方法、装置、服务器和计算机可读存储介质
CN117573359A (zh) * 2023-11-28 2024-02-20 之江实验室 一种基于异构集群的计算框架管理系统及方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060200552A1 (en) * 2005-03-07 2006-09-07 Beigi Mandis S Method and apparatus for domain-independent system parameter configuration
CN1955916A (zh) * 2005-10-27 2007-05-02 夏普株式会社 分布式打印控制系统和分布式打印控制方法
CN101697141A (zh) * 2009-10-30 2010-04-21 清华大学 网格中基于历史数据建模的作业性能预测方法
CN103064664A (zh) * 2012-11-28 2013-04-24 华中科技大学 一种基于性能预估的Hadoop参数自动优化方法和系统
US20130254196A1 (en) * 2012-03-26 2013-09-26 Duke University Cost-based optimization of configuration parameters and cluster sizing for hadoop
CN103605662A (zh) * 2013-10-21 2014-02-26 华为技术有限公司 一种分布式计算框架参数优化方法、装置及系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060200552A1 (en) * 2005-03-07 2006-09-07 Beigi Mandis S Method and apparatus for domain-independent system parameter configuration
CN1955916A (zh) * 2005-10-27 2007-05-02 夏普株式会社 分布式打印控制系统和分布式打印控制方法
CN101697141A (zh) * 2009-10-30 2010-04-21 清华大学 网格中基于历史数据建模的作业性能预测方法
US20130254196A1 (en) * 2012-03-26 2013-09-26 Duke University Cost-based optimization of configuration parameters and cluster sizing for hadoop
CN103064664A (zh) * 2012-11-28 2013-04-24 华中科技大学 一种基于性能预估的Hadoop参数自动优化方法和系统
CN103605662A (zh) * 2013-10-21 2014-02-26 华为技术有限公司 一种分布式计算框架参数优化方法、装置及系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710395A (zh) * 2017-10-26 2019-05-03 中国电信股份有限公司 参数优化控制方法、装置和分布式计算系统
CN109710395B (zh) * 2017-10-26 2021-05-14 中国电信股份有限公司 参数优化控制方法、装置和分布式计算系统

Also Published As

Publication number Publication date
CN103605662B (zh) 2017-02-22
CN103605662A (zh) 2014-02-26

Similar Documents

Publication Publication Date Title
WO2015058578A1 (zh) 一种分布式计算框架参数优化方法、装置及系统
US11615104B2 (en) Subquery generation based on a data ingest estimate of an external data system
US11321321B2 (en) Record expansion and reduction based on a processing task in a data intake and query system
US11599541B2 (en) Determining records generated by a processing task of a query
US20200364223A1 (en) Search time estimate in a data intake and query system
CN104903894B (zh) 用于分布式数据库查询引擎的系统和方法
US20190138642A1 (en) Execution of a query received from a data intake and query system
US10776170B2 (en) Software service execution apparatus, system, and method
CN105117286B (zh) MapReduce中任务的调度方法和流水化执行方法
US8965842B2 (en) Virtual environment spanning desktop and cloud
US8103656B2 (en) Integrated distributed query processor for data grids
CN102799622A (zh) 基于MapReduce扩展框架的分布式SQL查询方法
WO2015013954A1 (en) Near-duplicate filtering in search engine result page of an online shopping system
CN104408106A (zh) 一种用于分布式文件系统中大数据查询的调度方法
CN108228743A (zh) 一种实时大数据搜索引擎系统
CN110347515B (zh) 一种适合边缘计算环境的资源优化分配方法
WO2018040488A1 (zh) 一种处理连接查询的方法及装置
CN103198097A (zh) 一种基于分布式文件系统的海量地学数据并行处理方法
CN114416855A (zh) 一种基于电力大数据的可视化平台及方法
CN106339252B (zh) 分布式dag系统的自适应优化方法和装置
CN106471501A (zh) 数据查询的方法、数据对象的存储方法和数据系统
CN111258978A (zh) 一种数据存储的方法
US20160026663A1 (en) Distributing and processing streams over one or more networks for on-the-fly schema evolution
JP6262505B2 (ja) 分散型データ仮想化システム、クエリ処理方法及びクエリ処理プログラム
CN104778088A (zh) 一种基于减少进程间通信开销的并行i/o优化方法与系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14855153

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14855153

Country of ref document: EP

Kind code of ref document: A1