[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-07-08 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15367328#comment-15367328
 ] 

Yanyan Hu commented on MESOS-5425:
--

Yes, will apply 49381 to make a test and post the result. Thanks.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>Assignee: Yanyan Hu
>  Labels: mesosphere
> Attachments: graycol.gif
>
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-07-08 Thread Guangya Liu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15367301#comment-15367301
 ] 

Guangya Liu commented on MESOS-5425:


I'm linking MESOS-5700 here cause there is a patch 
https://reviews.apache.org/r/49381 which can help you doing some benchmark test.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>Assignee: Yanyan Hu
>  Labels: mesosphere
> Attachments: graycol.gif
>
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-06-11 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15326188#comment-15326188
 ] 

Yanyan Hu commented on MESOS-5425:
--

Hi, Guangya, the patch is published now, thanks.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
> Attachments: graycol.gif
>
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-06-11 Thread Guangya Liu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15326155#comment-15326155
 ] 

Guangya Liu commented on MESOS-5425:


Seems you did not publish your patch, I cannot open it.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-06-11 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15326154#comment-15326154
 ] 

Yanyan Hu commented on MESOS-5425:
--

Fix has been proposed here:
https://reviews.apache.org/r/48593/

The approach is re-implementing Ranges subtraction using IntervalSet data type: 
Ranges values(both subtrahend and minuend) are first converted to IntervalSet 
values. Then subtraction is done between these two IntervalSet values. The 
result is finally converted back to Ranges value.

Two new functions are added to make converting:

// Convert Ranges value to IntervalSet value
void Ranges2IntervalSet(const Value::Ranges& res, IntervalSet& set)

// Convert IntervalSet value to Ranges value
void IntervalSet2Ranges(const IntervalSet& set, Value::Ranges& res)

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-05-27 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15305167#comment-15305167
 ] 

Yanyan Hu commented on MESOS-5425:
--

Sure, will be very glad to post my existing work. I will read the following 
guide to understand how to submit a patch, thanks!

http://mesos.apache.org/documentation/latest/submitting-a-patch/

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-05-27 Thread Joseph Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15304353#comment-15304353
 ] 

Joseph Wu commented on MESOS-5425:
--

[~yanyanhu], can you post your existing work on Reviewboard?  The performance 
improvements look promising and I'd be happy to help review.  

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-05-23 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15296045#comment-15296045
 ] 

Yanyan Hu commented on MESOS-5425:
--

Will make more tests to see whether we can get Mesos allocator work more 
efficiently with this optimization. Thanks.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-05-23 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15296040#comment-15296040
 ] 

Yanyan Hu commented on MESOS-5425:
--

Hi, Joseph, I just made a quick test using "IntervalSet" data type: I first 
converted two "Ranges" values to "IntervalSet" values and performed subtraction 
operation between them. Then I converted the result "IntervalSet" back to 
"Ranges" value. Test results illustrate that the performance is much better 
when there are 1600 sub ranges in res2. The test result is as followed:

res2 range_size execution time(second)
1 0.010
100 0.028
200 0.030
400 0.035
800 0.044
1600 0.061

So just as you suggested that using IntervalSet in Port range resource math 
should be able to resolve this issue effectively.


> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-05-23 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15296038#comment-15296038
 ] 

Yanyan Hu commented on MESOS-5425:
--

Hi, Joseph, I just made a quick test using "IntervalSet" data type: I first 
converted two "Ranges" values to "IntervalSet" values and performed subtraction 
operation between them. Then I converted the result "IntervalSet" back to 
"Ranges" value. Test results illustrate that the performance is much better 
when there are 1600 sub ranges in res2. The test result is as followed:

res2 range_size execution time(second)
1 0.010
100 0.028
200 0.030
400 0.035
800 0.044
1600 0.061

So just as you suggested that using IntervalSet in Port range resource math can 
resolve this issue effectively.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (MESOS-5425) Consider using IntervalSet for Port range resource math

2016-05-22 Thread Yanyan Hu (JIRA)

[ 
https://issues.apache.org/jira/browse/MESOS-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15295833#comment-15295833
 ] 

Yanyan Hu commented on MESOS-5425:
--

Hi, Joseph, thanks for filing this jira. I copied my test result from 3051 to 
here:

Hi, guys, I'm now trying to use Mesos to manage a container cluster in large 
scale. And I'm using Mesos-0.25.0 with Marathon stays upon it. But when I made 
test using this environment, I found we still suffered from this issue when 
Marathon allocated port resource randomly.

In my test, three Mesos-slaves were activated with each one has available port 
resource of [31000-37000]. Then I tried to created more than 3000 tasks in 
three slave nodes. I found when task amount reached 3000, it cost nearly 800 
milisecond to finish a calculation of "Resources available = 
slaves[slaveId].total - slaves[slaveId].allocated
" which is performed in HierarchicalAllocatorProcess::allocate() function:
https://github.com/apache/mesos/blob/0.25.0/src/master/allocator/mesos/hierarchical.hpp#L1284

Since I have three Mesos-slaves, the total time consumption of each invoking 
for allocate() function is more than 2 seconds which make the performance of 
Mesos-master very terrible.

So I tried to made a simple test to evaluate the performance of "Ranges" value 
calculation. I found the performance of subtraction operation is still not good:

e.g. res1 = [1-6000], res2 = [1-1, 3-3, 5-5, ...]
I changed the range_size of res2 and recorded the execution time for "res1 -= 
res2", the result is as followed:
(Test was done in a x86 VM which has 4 process cores and 16GB memory)

res2 range_size execution time(second)
1   0.003 (0.002 in kernel mode)
100   0.011
200   0.031
400   0.121
800   0.533
1600 2.157

By comparison, the performance of addition and comparison operations are much 
better. So looks like the current fix haven't completely resolved this problem. 
Based on our test, the Mesos-master's performance seriously suffered from this 
issue when task amount is more than 1 with 20 activated Mesos-slave nodes.

I haven't tried latest Mesos release, but after checking the code of 
src/common/values.cpp in master branch, I found the implementation of "Ranges" 
data type is almost the same as in 0.25.0 release:
https://github.com/apache/mesos/blob/master/src/common/values.cpp
https://github.com/apache/mesos/blob/0.25.0/src/common/values.cpp

So I guess the problem is still there? So is there any way we can further 
optimize the implementation of "Ranges" data type so we can avoid this 
performance bottleneck? Thanks.

> Consider using IntervalSet for Port range resource math
> ---
>
> Key: MESOS-5425
> URL: https://issues.apache.org/jira/browse/MESOS-5425
> Project: Mesos
>  Issue Type: Improvement
>  Components: allocation
>Reporter: Joseph Wu
>  Labels: mesosphere
>
> Follow-up JIRA for comments raised in MESOS-3051 (see comments there).
> We should consider utilizing 
> [{{IntervalSet}}|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/3rdparty/stout/include/stout/interval.hpp]
>  in [Port range resource 
> math|https://github.com/apache/mesos/blob/a0b798d2fac39445ce0545cfaf05a682cd393abe/src/common/values.cpp#L143].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)