blob: e83075df3b6294fe2b833073323bf59d954b9abb [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at 2021-06-15
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop Resource Estimator Service &#x2013; Resource Estimator Service</title>
<style type="text/css" media="all">
@import url("./css/maven-base.css");
@import url("./css/maven-theme.css");
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20210615" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="index.html">Apache Hadoop Resource Estimator Service</a>
&gt;
Resource Estimator Service
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
&nbsp;| Last Published: 2021-06-15
&nbsp;| Version: 3.3.1
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../index.html">Overview</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
</li>
<li class="none">
<a href="../hadoop-kms/index.html">Hadoop KMS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
</li>
<li class="none">
<a href="../hadoop-hdfs-httpfs/index.html">HttpFS</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
</li>
</ul>
<h5>MapReduce REST APIs</h5>
<ul>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
</li>
</ul>
<h5>YARN Service</h5>
<ul>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
</li>
</ul>
<h5>Hadoop Compatible File Systems</h5>
<ul>
<li class="none">
<a href="../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
</li>
<li class="none">
<a href="../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
</li>
<li class="none">
<a href="../hadoop-azure/index.html">Azure Blob Storage</a>
</li>
<li class="none">
<a href="../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
</li>
<li class="none">
<a href="../hadoop-openstack/index.html">OpenStack Swift</a>
</li>
<li class="none">
<a href="../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Tools</h5>
<ul>
<li class="none">
<a href="../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
</li>
<li class="none">
<a href="../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
</li>
<li class="none">
<a href="../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
</li>
<li class="none">
<a href="../hadoop-distcp/DistCp.html">DistCp</a>
</li>
<li class="none">
<a href="../hadoop-gridmix/GridMix.html">GridMix</a>
</li>
<li class="none">
<a href="../hadoop-rumen/Rumen.html">Rumen</a>
</li>
<li class="none">
<a href="../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
</li>
<li class="none">
<a href="../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
</li>
<li class="none">
<a href="../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
</li>
<li class="none">
<a href="../api/index.html">Java API docs</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-kms/kms-default.html">kms-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
</li>
<li class="none">
<a href="../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="./images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!---
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<h1>Resource Estimator Service</h1>
<ul>
<li><a href="#Resource_Estimator_Service">Resource Estimator Service</a>
<ul>
<li><a href="#Overview">Overview</a>
<ul>
<li><a href="#Motivation">Motivation</a></li>
<li><a href="#Goals">Goals</a></li>
<li><a href="#Architecture">Architecture</a></li>
</ul>
</li>
<li><a href="#Usage">Usage</a></li>
<li><a href="#Example">Example</a></li>
<li><a href="#AdvancedConfig">Advanced Configuration</a></li>
<li><a href="#Future">Future work</a></li>
</ul>
</li>
</ul>
<div class="section">
<h2><a name="Overview"></a>Overview</h2>
<div class="section">
<h3><a name="Motivation"></a>Motivation</h3>
<p>Estimating job resource requirements remains an important and challenging problem for enterprise clusters. This is amplified by the ever-increasing complexity of workloads, i.e. from traditional batch jobs to interactive queries to streaming and recently machine learning jobs. This results in jobs relying on multiple computation frameworks such as Tez, MapReduce, Spark, etc., and the problem is further compounded by sharing nature of the clusters. Current state-of-art solution relies on user expertise to make resource requirement estimations for the jobs (for e.g.: number of reducers or container memory size, etc.), which is both tedious and inefficient.</p>
<p>Based on the analysis of our cluster workloads, we observe that a large portion of jobs (more than 60%) are recurring jobs, giving us the opportunity to automatically estimate job resource requirements based on job&#x2019;s history runs. It is worth noting that jobs usually come from different computation frameworks, and the version may change across runs as well. Therefore, we want to come up with a framework agnostic black-box solution to automatically make resource requirement estimation for the recurring jobs.</p></div>
<div class="section">
<h3><a name="Goals"></a>Goals</h3>
<ul>
<li>For a periodic job, analyze its history logs and predict its resource requirement for the new run.</li>
<li>Support various types of job logs.</li>
<li>Scale to terabytes of job logs.</li>
</ul></div>
<div class="section">
<h3><a name="Architecture"></a>Architecture</h3>
<p>The following figure illustrates the implementation architecture of the resource estimator.</p>
<p><img src="images/resourceestimator_arch.png" alt="The architecture of the resource estimator" /></p>
<p>Hadoop-resourceestimator mainly consists of three modules: Translator, SkylineStore and Estimator.</p>
<ol style="list-style-type: decimal">
<li><tt>ResourceSkyline</tt> is used to characterize job&#x2019;s resource utilizations during its lifespan. More specifically, it uses <tt>RLESparseResourceAllocation</tt> (<a class="externalLink" href="https://github.com/apache/hadoop/blob/b6e7d1369690eaf50ce9ea7968f91a72ecb74de0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/RLESparseResourceAllocation.java">https://github.com/apache/hadoop/blob/b6e7d1369690eaf50ce9ea7968f91a72ecb74de0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/RLESparseResourceAllocation.java</a>) to record the container allocation information. <tt>RecurrenceId</tt> is used to identify a specific run of a recurring pipeline. A pipeline could consist of multiple jobs, each has a <tt>ResourceSkyline</tt> to characterize its resource utilization.</li>
<li><tt>Translator</tt> parses the job logs, extracts their <tt>ResourceSkylines</tt> and stores them to the SkylineStore. <tt>SingleLineParser</tt> parses one line in the log stream and extract the <tt>ResourceSkyline</tt>. <tt>LogParser</tt> recursively parses each line in the log stream using <tt>SingleLineParser</tt>. Note that logs could have different storage formats, so <tt>LogParser</tt> takes a stream of strings as input, instead of File or other formats. Since job logs may have various formats thus require different <tt>SingleLineParser</tt> implementations, <tt>LogParser</tt> initiates the <tt>SingleLineParser</tt> based on user configuration. Currently Hadoop-resourceestimator provides two implementations for <tt>SingleLineParser</tt>: <tt>NativeSingleLineParser</tt> supports an optimized native format, and <tt>RMSingleLineParser</tt> parses the YARN ResourceManager logs generated in Hadoop systems since RM logs are widely available (in production deployments).</li>
<li><tt>SkylineStore</tt> serves as the storage layer for Hadoop-resourceestimator and consists of 2 parts. <tt>HistorySkylineStore</tt> stores the <tt>ResourceSkylines</tt> extracted by the <tt>Translator</tt>. It supports four actions: addHistory, deleteHistory, updateHistory and getHistory. addHistory appends new <tt>ResourceSkylines</tt> to the recurring pipelines, while updateHistory deletes all the <tt>ResourceSkylines</tt> of a specific recurring pipeline, and re-insert new <tt>ResourceSkylines</tt>. <tt>PredictionSkylineStore</tt> stores the predicted <tt>RLESparseResourceAllocation</tt> generated by the Estimator. It supports two actions: addEstimation and getEstimation.
<p>Currently Hadoop-resourceestimator provides in-memory implementation for the SkylineStore.</p></li>
<li><tt>Estimator</tt> predicts recurring pipeline&#x2019;s resource requirements based on its history runs, stores the prediction to the <tt>SkylineStore</tt> and makes recurring resource reservations to YARN (YARN-5326). <tt>Solver</tt> reads all the history <tt>ResourceSkylines</tt> of a specific recurring pipeline, and predicts its new resource requirements wrapped in <tt>RLESparseResourceAllocation</tt>. Currently Hadoop-resourceestimator provides a <tt>LPSOLVER</tt> to make the prediction (the details of the Linear Programming model can be find in the paper). There is also a <tt>BaseSolver</tt> to translate predicted resource requirements into <tt>ReservationSubmissionRequest</tt> which is used by different solver implementations to make recurring resource reservations on YARN.</li>
<li><tt>ResourceEstimationService</tt> wraps Hadoop-resourceestimator as a micro-service, which can be easily deployed in clusters. It provides a set of REST APIs to allow users to parse specified job logs, query pipeline&#x2019;s history <tt>ResourceSkylines</tt>, query pipeline&#x2019;s predicted resource requirements and run the <tt>SOLVER</tt> if the prediction does not exist, delete the <tt>ResourceSkylines</tt> in the <tt>SkylineStore</tt>.</li>
</ol></div></div>
<div class="section">
<h2><a name="Usage"></a>Usage</h2>
<p>This section will guide you through the usage of resource estimator service.</p>
<p>Here let <tt>$HADOOP_ROOT</tt> represent the Hadoop install directory. If you build Hadoop yourself, <tt>$HADOOP_ROOT</tt> is <tt>hadoop-dist/target/hadoop-$VERSION</tt>. The location of the resource estimator service, <tt>$ResourceEstimatorServiceHome</tt>, is <tt>$HADOOP_ROOT/share/hadoop/tools/resourceestimator</tt>. It contains 3 folders: <tt>bin</tt>, <tt>conf</tt> and <tt>data</tt>. Please note that users can use resource estimator service with the default configurations.</p>
<ul>
<li>
<p><tt>bin</tt> contains the running scripts for the resource estimator service.</p>
</li>
<li>
<p><tt>conf</tt>: contains the configuration files for the resource estimator service.</p>
</li>
<li>
<p><tt>data</tt> contains the sample log that is used to run the example of resource estimator service.</p>
</li>
</ul>
<div class="section">
<h3><a name="Step_1:_Start_the_estimator"></a>Step 1: Start the estimator</h3>
<p>First of all, copy the configuration file (located in <tt>$ResourceEstimatorServiceHome/conf/</tt>) to <tt>$HADOOP_ROOT/etc/hadoop</tt>.</p>
<p>The script to start the estimator is <tt>start-estimator.sh</tt>.</p>
<div>
<div>
<pre class="source">$ cd $ResourceEstimatorServiceHome
$ bin/start-estimator.sh
</pre></div></div>
<p>A web server is started, and users can use the resource estimation service through REST APIs.</p></div>
<div class="section">
<h3><a name="Step_2:_Run_the_estimator"></a>Step 2: Run the estimator</h3>
<p>The URI for the resource estimator sercive is <tt>http://0.0.0.0</tt>, and the default service port is <tt>9998</tt> (configured in <tt>$ResourceEstimatorServiceHome/conf/resourceestimator-config.xml</tt>). In <tt>$ResourceEstimatorServiceHome/data</tt>, there is a sample log file <tt>resourceEstimatorService.txt</tt> which contains the logs of tpch_q12 query job for 2 runs.</p>
<ul>
<li><tt>parse job logs: POST http://URI:port/resourceestimator/translator/LOG_FILE_DIRECTORY</tt></li>
</ul>
<p>Send <tt>POST http://0.0.0.0:9998/resourceestimator/translator/data/resourceEstimatorService.txt</tt>. The underlying estimator will extract the ResourceSkylines from the log file and store them in the jobHistory SkylineStore.</p>
<ul>
<li><tt>query job's history ResourceSkylines: GET http://URI:port/resourceestimator/skylinestore/history/{pipelineId}/{runId}</tt></li>
</ul>
<p>Send <tt>GET http://0.0.0.0:9998/resourceestimator/skylinestore/history/*/*</tt>, and the underlying estimator will return all the records in history SkylineStore. You should be able to see ResourceSkylines for two runs of tpch_q12: tpch_q12_0 and tpch_q12_1. Note that both <tt>pipelineId</tt> and <tt>runId</tt> fields support wildcard operations.</p>
<ul>
<li><tt>predict job's resource skyline requirement: GET http://URI:port/resourceestimator/estimator/{pipelineId}</tt></li>
</ul>
<p>Send <tt>http://0.0.0.0:9998/resourceestimator/estimator/tpch_q12</tt>, and the underlying estimator will predict job&#x2019;s resource requirements for the new run based on its history ResourceSkylines, and store the predicted resource requirements to jobEstimation SkylineStore.</p>
<ul>
<li><tt>query job's estimated resource skylines: GET http://URI:port/resourceestimator/skylinestore/estimation/{pipelineId}</tt></li>
</ul>
<p>Send <tt>http://0.0.0.0:9998/resourceestimator/skylinestore/estimation/tpch_q12</tt>, and the underlying estimator will return the history resource requirement estimation for tpch_q12 job. Note that for jobEstimation SkylineStore, it does not support wildcard operations.</p>
<ul>
<li><tt>delete job's history resource skylines: DELETE http://URI:port/resourceestimator/skylinestore/history/{pipelineId}/{runId}</tt></li>
</ul>
<p>Send <tt>http://0.0.0.0:9998/resourceestimator/skylinestore/history/tpch_q12/tpch_q12_0</tt>, and the underlying estimator will delete the ResourceSkyline record for tpch_q12_0. Re-send <tt>GET http://0.0.0.0:9998/resourceestimator/skylinestore/history/*/*</tt>, and the underlying estimator will only return the ResourceSkyline for tpch_q12_1.</p></div>
<div class="section">
<h3><a name="Step_3:_Run_the_estimator"></a>Step 3: Run the estimator</h3>
<p>The script to stop the estimator is <tt>stop-estimator.sh</tt>.</p>
<div>
<div>
<pre class="source">$ cd $ResourceEstimatorServiceHome
$ bin/stop-estimator.sh
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Example"></a>Example</h2>
<p>Here we present an example for using Resource Estimator Service.</p>
<p>First, we run a tpch_q12 job for 9 times, and collect job&#x2019;s resource skylines in each run (note that in this example, we only collect &#x201c;# of allocated containers&#x201d; information).</p>
<p>Then, we run the log parser in Resource Estimator Service to extract the ResourceSkylines from logs and store them in the SkylineStore. The job&#x2019;s ResourceSkylines are plotted below for demonstration.</p>
<p><img src="images/tpch_history.png" alt="Tpch job history runs" /></p>
<p>Finally, we run the estimator in Resource Estimator Service to predict the resource requirements for the new run, which is wrapped in RLESparseResourceAllocation (<a class="externalLink" href="https://github.com/apache/hadoop/blob/b6e7d1369690eaf50ce9ea7968f91a72ecb74de0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/RLESparseResourceAllocation.java">https://github.com/apache/hadoop/blob/b6e7d1369690eaf50ce9ea7968f91a72ecb74de0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/RLESparseResourceAllocation.java</a>). The predicted resource requirement is plotted below for demonstration.</p>
<p><img src="images/tpch_predict.png" alt="Tpch job history prediction" /></p></div>
<div class="section">
<h2><a name="Advanced_Configuration"></a>Advanced Configuration</h2>
<p>This section will guide you through the configuration for Resource Estimator Service. The configuration file is located at <tt>$ResourceEstimatorServiceHome/conf/resourceestimator-config.xml</tt>.</p>
<ul>
<li><tt>resourceestimator.solver.lp.alpha</tt></li>
</ul>
<p>The resource estimator has an integrated Linear Programming solver to make the prediction (refer to <a class="externalLink" href="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/10/osdi16-final107.pdf">https://www.microsoft.com/en-us/research/wp-content/uploads/2016/10/osdi16-final107.pdf</a> for more details), and this parameter tunes the tradeoff between resource over-allocation and under-allocation in the Linear Programming model. This parameter varies from 0 to 1, and a larger alpha value means the model minimizes over-allocation better. Default value is 0.1.</p>
<ul>
<li><tt>resourceestimator.solver.lp.beta</tt></li>
</ul>
<p>This parameter controls the generalization of the Linear Programming model. This parameter varies from 0 to 1. Deafult value is 0.1.</p>
<ul>
<li><tt>resourceestimator.solver.lp.minJobRuns</tt></li>
</ul>
<p>The minimum number of job runs required in order to make the prediction. Default value is 2.</p>
<ul>
<li><tt>resourceestimator.timeInterval</tt></li>
</ul>
<p>The time length which is used to discretize job execution into intervals. Note that the estimator makes resource allocation prediction for each interval. A smaller time interval has more fine-grained granularity for prediction, but it also takes longer time and more space for prediction. Default value is 5 (seconds).</p>
<ul>
<li><tt>resourceestimator.skylinestore.provider</tt></li>
</ul>
<p>The class name of the skylinestore provider. Default value is <tt>org.apache.hadoop.resourceestimator.skylinestore.impl.InMemoryStore</tt>, which is an in-memory implementation of skylinestore. If users want to use their own skylinestore implementation, they need to change this value accordingly.</p>
<ul>
<li><tt>resourceestimator.translator.provider</tt></li>
</ul>
<p>The class name of the translator provider. Default value is <tt>org.apache.hadoop.resourceestimator.translator.impl.BaseLogParser</tt>, which extracts resourceskylines from log streams. If users want to use their own translator implementation, they need to change this value accordingly.</p>
<ul>
<li><tt>resourceestimator.translator.line-parser</tt></li>
</ul>
<p>The class name of the translator single-line parser, which parses a single line in the log. Default value is <tt>org.apache.hadoop.resourceestimator.translator.impl.NativeSingleLineParser</tt>, which can parse one line in the sample log. Note that if users want to parse Hadoop Resource Manager (<a class="externalLink" href="https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html">https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html</a>) logs, they need to set the value to be <tt>org.apache.hadoop.resourceestimator.translator.impl.RmSingleLineParser</tt>. If they want to implement single-line parser to parse their customized log file, they need to change this value accordingly.</p>
<ul>
<li><tt>resourceestimator.solver.provider</tt></li>
</ul>
<p>The class name of the solver provider. Default value is <tt>org.apache.hadoop.resourceestimator.solver.impl.LpSolver</tt>, which incorporates a Linear Programming model to make the prediction. If users want to implement their own models, they need to change this value accordingly.</p>
<ul>
<li><tt>resourceestimator.service-port</tt></li>
</ul>
<p>The port which ResourceEstimatorService listens to. The default value is 9998.</p></div>
<div class="section">
<h2><a name="Future_work"></a>Future work</h2>
<ol style="list-style-type: decimal">
<li>
<p>For SkylineStore, we plan to provide a persistent store implementation. We are considering HBase to future proof our scale requirements.</p>
</li>
<li>
<p>For Translator module, we want to support Timeline Service v2 as the primary source as we want to rely on a stable API and logs are flaky at best.</p>
</li>
<li>
<p>Job resource requirements could vary across runs due to skewness, contention, input data or code changes, etc. We want to design a Reprovisioner module, which dynamically monitors job progress at runtime, identifies the performance bottlenecks if the progress is slower than expectation, and dynamically adjusts job&#x2019;s resource allocations accordingly using ReservationUpdateRequest.</p>
</li>
<li>
<p>When Estimator predicts job&#x2019;s resource requirements, we want to provide the confidence level associated with the prediction according to the estimation error (combination of over-allocation and under-allocation), etc.</p>
</li>
<li>
<p>For Estimator module, we can integrate machine learning tools such as reinforcement learning to make better prediction. We can also integrate with domain-specific solvers such as PerfOrator to improve prediction quality.</p>
</li>
<li>
<p>For Estimator module, we want to design incremental solver, which can incrementally update job&#x2019;s resource requirements only based on the new logs.</p>
</li>
</ol></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
&#169; 2008-2021
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>