Skip to content

Add peak memory distribution among tasks of each stage#13379

Merged
arhimondr merged 3 commits intoprestodb:masterfrom
viczhang861:write-task
Oct 24, 2019
Merged

Add peak memory distribution among tasks of each stage#13379
arhimondr merged 3 commits intoprestodb:masterfrom
viczhang861:write-task

Conversation

@viczhang861
Copy link
Contributor

@viczhang861 viczhang861 commented Sep 11, 2019

Resolves #13327

== RELEASE NOTES ==

General Changes
* Add peak total memory distribution among tasks of each stage

@viczhang861 viczhang861 force-pushed the write-task branch 3 times, most recently from 83e8cf1 to f85def4 Compare September 11, 2019 15:15
@viczhang861 viczhang861 changed the title [WIP]Add peak memory distribution among tasks of each stage Add peak memory distribution among tasks of each stage Sep 11, 2019
@aweisberg aweisberg self-requested a review September 11, 2019 18:37
Copy link
Contributor

@aweisberg aweisberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit about TaskDistribution constructor. Otherwise it makes sense to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why reduce precision?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For current purpose of using this class for either memory bytes or cpu time, float precision is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it back double to avoid confusion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructing a task distribution is very verbose and a lot of this stuff comes from a DistributionSnapshot, can you update the TaskDistributionConstructor to reduce some of this duplication by working on the DistributionSnapshot directly?

Copy link
Contributor Author

@viczhang861 viczhang861 Sep 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intended to support serialization into json string. There is downstream dependency on structure of this class, e.g. visualization of distribution.

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add peak total memory of a task to TaskStats

  • Some questions.
  • I'd update commit message to Add peak total memory to TaskStats

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • cumulativeUserMemory is stored as double; peakTotalMemoryInBytes seems similar, but it stored as long; why is the discrepancy?
  • peakTotalMemoryInBytes name is not consistent with cumulativeUserMemory; shouldn't it be peakTotalMemory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • cumulativeUserMemory uses double as its unit is Bytes * Time, this explains the difference of names

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viczhang861 Vic, thanks for explaining. It makes sense now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at cumulativeUserMemory, I'd expect

@JsonProperty("peakTotalMemory") double peakTotalMemory,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or peakTotalMemoryReservation and use DataSize as type? No strong opinion here.

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename StageCpuDistribution to TaskDistribution

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if it would be useful to keep Stage in the name. The data is the distribution of task resource usage within a stage, right? StageResourceDistribution maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to ResourceDistribution to avoid confusion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated change and therefore should go into separate commit. My preference would be to keep double though. Primarily to avoid having other readers wonder why float.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add peak memory distribution among tasks of each stage

Looks good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: perhaps, computeResourceDistributions or computeCpuAndMemoryDistributions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mbasmanova mbasmanova requested a review from a team September 13, 2019 17:30
@oerling
Copy link

oerling commented Sep 13, 2019 via email

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@viczhang861 Thanks.

Copy link
Contributor

@wenleix wenleix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or peakTotalMemoryReservation and use DataSize as type? No strong opinion here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about taskPeakMemoryDistribution? No strong opinion since peakMemoryDistribution is parallel to cpuTimeDistribution

@arhimondr arhimondr merged commit 88416e5 into prestodb:master Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record memory usage percentiles

7 participants