Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrease size of Allocation when serializing #867

Merged
merged 1 commit into from
Mar 1, 2016

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Mar 1, 2016

This PR causes the scheduler to not add the following to Allocations:

  • The TaskStates map as this is now populated by the client for the pending status
  • Remove the Resources field which is just the summation of each Task's resources and calculate it after serialization.

These result in a roughly 15% size reduction of the AllocUpdateRequest.

We should look into having the stack not return the size as it is no longer being used.

cc: @armon

@@ -58,8 +58,20 @@ func AllocsFit(node *Node, allocs []*Allocation, netIdx *NetworkIndex) (bool, st

// For each alloc, add the resources
for _, alloc := range allocs {
if err := used.Add(alloc.Resources); err != nil {
return false, "", nil, err
if alloc.Resources != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this at all? Can't we always re-build?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After it is built once it is stored in memory to save compute time.

@diptanu
Copy link
Contributor

diptanu commented Mar 1, 2016

LGTM overall.

dadgar added a commit that referenced this pull request Mar 1, 2016
Decrease size of Allocation when serializing
@dadgar dadgar merged commit 94e56b3 into master Mar 1, 2016
@dadgar dadgar deleted the f-reduce-alloc-update-size branch March 1, 2016 23:38
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants