Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Reduce am resource (#2072)
Browse files Browse the repository at this point in the history
* reduce am resource to 1G

* fix test

* increase yarn virtual memory limit

* move hard-code to config

* add other am resource config
  • Loading branch information
mzmssg authored Jan 31, 2019
1 parent 50c26cb commit 1e6c84d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
<description>Number of memory that can be allocated for containers.</description>
</property>

<property>
<name>yarn.nodemanager.vmem-pmem-ratio</name>
<value>6</value>
<description>
Ratio between virtual memory to physical memory when setting memory limits for containers.
Container allocations are expressed in terms of physical memory, and virtual memory usage
is allowed to exceed this allocation by this ratio.
</description>
</property>

<property>
<name>yarn.resourcemanager.max-completed-applications</name>
<value>1000</value>
Expand Down
24 changes: 24 additions & 0 deletions src/rest-server/src/config/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ let launcherConfig = {
jobDirCleanUpIntervalSecond: 7200,
jobConfigFileName: 'JobConfig.json',
frameworkDescriptionFilename: 'FrameworkDescription.json',
amResource: {
cpuNumber: 1,
memoryMB: 1024,
diskType: 0,
diskMB: 0,
},
};

launcherConfig.healthCheckPath = () => {
Expand Down Expand Up @@ -125,6 +131,24 @@ const launcherConfigSchema = Joi.object().keys({
.default('JobConfig.json'),
frameworkDescriptionFilename: Joi.string()
.default('FrameworkDescription.json'),
amResource: Joi.object().keys({
cpuNumber: Joi.number()
.integer()
.min(1)
.default(1),
memoryMB: Joi.number()
.integer()
.min(1024)
.default(4096),
diskType: Joi.number()
.integer()
.default(0),
diskMB: Joi.number()
.integer()
.min(0)
.default(0),
}),

}).required();

const {error, value} = Joi.validate(launcherConfig, launcherConfigSchema);
Expand Down
6 changes: 6 additions & 0 deletions src/rest-server/src/models/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ class Job {
'queue': virtualCluster,
'taskNodeGpuType': gpuType,
'gangAllocation': true,
'amResource': {
'cpuNumber': launcherConfig.amResource.cpuNumber,
'memoryMB': launcherConfig.amResource.memoryMB,
'diskType': launcherConfig.amResource.diskType,
'diskMB': launcherConfig.amResource.diskMB,
},
},
};
for (let i = 0; i < data.taskRoles.length; i++) {
Expand Down

0 comments on commit 1e6c84d

Please sign in to comment.