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

Optimize task queueing #902

Closed
drexin opened this issue Dec 19, 2014 · 3 comments
Closed

Optimize task queueing #902

drexin opened this issue Dec 19, 2014 · 3 comments
Milestone

Comments

@drexin
Copy link
Contributor

drexin commented Dec 19, 2014

Currently an app is being added n times to the task queue during a deployment. It would be a lot more efficient to add it only once and include a counter, so that we only match it once against an offer.

@adam-mesos adam-mesos added this to the 0.7.7 milestone Dec 24, 2014
@sttts
Copy link
Contributor

sttts commented Jan 5, 2015

Just for my understanding: what exactly is so expensive that it deserves this big optimization of the task queue? What's the complexity of the offer comparison?

Which order of magnitude of tasks can we expect? 10000?

@drexin
Copy link
Contributor Author

drexin commented Jan 7, 2015

I think we can expect hundreds of thousands of tasks on up to hundreds of thousands of machines. Finding a matching task has quadratic complexity, so if we just add the same app N times, we have a worst case of 100.000 x 100.000 calls to the matching function. Matching also is very expensive. We have seen cases, where Marathon couldn't catch up with the offers.

@sttts
Copy link
Contributor

sttts commented Jan 7, 2015

Ok, O(n^2) is a good reason.

What I saw a lot throughout the code are linear loops over lists of tasks. When calling those indirectly we easily also get bad runtime behavior, but harder to spot.

@drexin drexin closed this as completed in 646e0fd Jan 13, 2015
drexin added a commit that referenced this issue Jan 13, 2015
fixes #902 - optimized task queueing behavior
@d2iq-archive d2iq-archive locked and limited conversation to collaborators Mar 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants