<p dir="ltr"><br>
On Jul 22, 2013 7:13 PM, "Joshua Harlow" <<a href="mailto:harlowja@yahoo-inc.com">harlowja@yahoo-inc.com</a>> wrote:<br>
><br>
> An interesting idea, I'm not sure how useful it is but it could be.<br>
><br>
> If you think of the compute node capability information as an 'event stream' then you could imagine using something like apache flume (<a href="http://flume.apache.org/">http://flume.apache.org/</a>) or storm (<a href="http://storm-project.net/">http://storm-project.net/</a>) to be able to sit on this stream and perform real-time analytics of said stream to update how scheduling can be performed. Maybe the MQ or ceilometer can be the same 'stream' source but it doesn't seem like it is needed to 'tie' the impl to those methods. If you consider compute nodes as producers of said data and then hook a real-time processing engine on-top that can adjust some scheduling database used by a scheduler then it seems like u could vary how often compute nodes produce said stream info, where and how said stream info is stored and analyzed which will allow you to then adjust how 'real-time' you want said compute scheduling capability information to be up to date. </p>

<p dir="ltr">Interesting idea, but not sure if its the right solution.  There are two known issues today<br>
* periodic updates can overwhelm things.  Solution: remove unneeded updates, most scheduling data only changes when an instance does some state change.<br>
* according to Boris doing a get all hosts from the db doesn't scale.  Solution: there are several possibilities.</p>
<p dir="ltr">Neither scale issue today is helped with flume.  But this concept may be useful in the future</p>
<p dir="ltr">><br>
> Just seems that real-time processing  is a similar model as what is needed here.<br>
><br>
> Maybe something like that is where this should end up?<br>
><br>
> -Josh<br>
><br>
> From: Joe Gordon <<a href="mailto:joe.gordon0@gmail.com">joe.gordon0@gmail.com</a>><br>
> Reply-To: OpenStack Development Mailing List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
> Date: Monday, July 22, 2013 3:47 PM<br>
> To: OpenStack Development Mailing List <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
><br>
> Subject: Re: [openstack-dev] A simple way to improve nova scheduler<br>
><br>
><br>
><br>
><br>
> On Mon, Jul 22, 2013 at 5:16 AM, Boris Pavlovic <<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a>> wrote:<br>
>><br>
>> Joe, <br>
>><br>
>> >> Speaking of Chris Beherns  "Relying on anything but the DB for current memory free, etc, is just too laggy… so we need to stick with it, IMO." <a href="http://lists.openstack.org/pipermail/openstack-dev/2013-June/010485.html">http://lists.openstack.org/pipermail/openstack-dev/2013-June/010485.html</a><br>

>><br>
>> It doesn't scale, use tons of resources, works slow and is hard to extend.<br>
>> Also the mechanism of getting free and used memory is done by virt layer. <br>
>> And only thing that could be laggy is rpc (but it is used also by compute node update) <br>
><br>
><br>
> You say it doesn't scale and uses tons of resources can you show to reproduce your findings.  Also just because the current implementation of the scheduler is non-optimal doesn't mean the no DB is the only solution, I am interested in seeing other possible solutions before going down such a drastically different road (no-db).  Such as pushing more of the logic into the DB and not searching through all compute nodes in python space or looking at removing the periodic updates all  together or ???.<br>

>  <br>
>><br>
>><br>
>><br>
>> >> * How do you bring a new scheduler up in an existing deployment and make it get the full state of the system?<br>
>><br>
>> You should wait for a one periodic task time. And you will get full information about all compute nodes. <br>
><br>
><br>
> sure, that may work we need to add logic in to handle this.<br>
><br>
>><br>
>> >> *  Broadcasting RPC updates from compute nodes to the scheduler means every scheduler has to process  the same RPC message.  And if a deployment hits the point where the number of compute updates is consuming 99 percent of the scheduler's time just adding another scheduler won't fix anything as it will get bombarded too.<br>

>><br>
>><br>
>> If we are speaking about numbers. You are able to see our doc, where they are counted. <br>
>> If we have 10k nodes it will make only 150rpc calls/sec (which means nothing for cpu). By the way we way we will remove 150 calls/s from conductor. One more thing currently in 10nodes deployment I think we will spend almost all time fro waiting DB (compute_nodes_get_all()). And also when we are calling this method in this moment we should process all data for 60 sec. (So in this case in numbers we are doing on scheduler side 60*request_pro_sec of our approach. Which means if we get more then 1 request pro sec we will do more CPU load.)<br>

><br>
><br>
> There are deployments in production (bluehost) that are already bigger then 10k nodes, AFAIK the last numbers I heard were 16k nodes and they didn't use our scheduler at all. So a better upper limit would be something like 30k nodes.  At that scale we get 500 RPC broadcasts per second (assuming 60 second periodic update) from periodic updates, plus updates from state changes.  If we assume only 1% of compute nodes have instances that are changing state that is an additional 300 RPC broadcasts to the schedulers per second.  So now we have 800 per second.  How many RPC updates (from compute node to scheduler) per second can a single python thread handle without DB access? With DB Access?<br>

><br>
> As for your second point, I don't follow can you elaborate.<br>
><br>
><br>
><br>
>  <br>
>><br>
>><br>
>><br>
>> >> Also OpenStack is already deeply invested in using the central DB model for the state of the 'world' and while I am not against changing that, I think we should evaluate that switch in a larger context.<br>

>><br>
>> Step by step. As first step we could just remove compute_node_get_all method. Which will make our openstack much scalable and fast. <br>
><br>
><br>
> Yes, step by step is how to fix something.  But before going in this direction it is worth a larger discussion of how we *want* things to look and in what direction we should be moving in.  If we want to use this model, we should consider where else it can help,  other repercussions etc. <br>

><br>
>><br>
>><br>
>> By the way see one more time answers on your comments in doc. <br>
>><br>
>> Best regards,<br>
>> Boris Pavlovic<br>
>><br>
>> Mirantis Inc. <br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Sat, Jul 20, 2013 at 3:14 AM, Joe Gordon <<a href="mailto:joe.gordon0@gmail.com">joe.gordon0@gmail.com</a>> wrote:<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> On Fri, Jul 19, 2013 at 3:13 PM, Sandy Walsh <<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>> wrote:<br>
>>>><br>
>>>><br>
>>>><br>
>>>> On 07/19/2013 05:36 PM, Boris Pavlovic wrote:<br>
>>>> > Sandy,<br>
>>>> ><br>
>>>> > I don't think that we have such problems here.<br>
>>>> > Because scheduler doesn't pool compute_nodes.<br>
>>>> > The situation is another compute_nodes notify scheduler about their<br>
>>>> > state. (instead of updating their state in DB)<br>
>>>> ><br>
>>>> > So for example if scheduler send request to compute_node, compute_node<br>
>>>> > is able to run rpc call to schedulers immediately (not after 60sec).<br>
>>>> ><br>
>>>> > So there is almost no races.<br>
>>>><br>
>>>> There are races that occur between the eventlet request threads. This is<br>
>>>> why the scheduler has been switched to single threaded and we can only<br>
>>>> run one scheduler.<br>
>>>><br>
>>>> This problem may have been eliminated with the work that Chris Behrens<br>
>>>> and Brian Elliott were doing, but I'm not sure.<br>
>>><br>
>>><br>
>>><br>
>>> Speaking of Chris Beherns  "Relying on anything but the DB for current memory free, etc, is just too laggy… so we need to stick with it, IMO." <a href="http://lists.openstack.org/pipermail/openstack-dev/2013-June/010485.html">http://lists.openstack.org/pipermail/openstack-dev/2013-June/010485.html</a><br>

>>><br>
>>> Although there is some elegance to the proposal here I have some concerns.<br>
>>><br>
>>> If just using RPC broadcasts from compute to schedulers to keep track of things, we get two issues: <br>
>>><br>
>>> * How do you bring a new scheduler up in an existing deployment and make it get the full state of the system?<br>
>>> * Broadcasting RPC updates from compute nodes to the scheduler means every scheduler has to process  the same RPC message.  And if a deployment hits the point where the number of compute updates is consuming 99 percent of the scheduler's time just adding another scheduler won't fix anything as it will get bombarded too.<br>

>>><br>
>>> Also OpenStack is already deeply invested in using the central DB model for the state of the 'world' and while I am not against changing that, I think we should evaluate that switch in a larger context.<br>

>>><br>
>>>  <br>
>>>><br>
>>>><br>
>>>> But certainly, the old approach of having the compute node broadcast<br>
>>>> status every N seconds is not suitable and was eliminated a long time ago.<br>
>>>><br>
>>>> ><br>
>>>> ><br>
>>>> > Best regards,<br>
>>>> > Boris Pavlovic<br>
>>>> ><br>
>>>> > Mirantis Inc.<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > On Sat, Jul 20, 2013 at 12:23 AM, Sandy Walsh <<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a><br>
>>>> > <mailto:<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>>> wrote:<br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> >     On 07/19/2013 05:01 PM, Boris Pavlovic wrote:<br>
>>>> >     > Sandy,<br>
>>>> >     ><br>
>>>> >     > Hm I don't know that algorithm. But our approach doesn't have<br>
>>>> >     > exponential exchange.<br>
>>>> >     > I don't think that in 10k nodes cloud we will have a problems with 150<br>
>>>> >     > RPC call/sec. Even in 100k we will have only 1.5k RPC call/sec.<br>
>>>> >     > More then (compute nodes update their state in DB through conductor<br>
>>>> >     > which produce the same count of RPC calls).<br>
>>>> >     ><br>
>>>> >     > So I don't see any explosion here.<br>
>>>> ><br>
>>>> >     Sorry, I was commenting on Soren's suggestion from way back (essentially<br>
>>>> >     listening on a separate exchange for each unique flavor ... so no<br>
>>>> >     scheduler was needed at all). It was a great idea, but fell apart rather<br>
>>>> >     quickly.<br>
>>>> ><br>
>>>> >     The existing approach the scheduler takes is expensive (asking the db<br>
>>>> >     for state of all hosts) and polling the compute nodes might be do-able,<br>
>>>> >     but you're still going to have latency problems waiting for the<br>
>>>> >     responses (the states are invalid nearly immediately, especially if a<br>
>>>> >     fill-first scheduling algorithm is used). We ran into this problem<br>
>>>> >     before in an earlier scheduler implementation. The round-tripping kills.<br>
>>>> ><br>
>>>> >     We have a lot of really great information on Host state in the form of<br>
>>>> >     notifications right now. I think having a service (or notification<br>
>>>> >     driver) listening for these and keeping an the HostState incrementally<br>
>>>> >     updated (and reported back to all of the schedulers via the fanout<br>
>>>> >     queue) would be a better approach.<br>
>>>> ><br>
>>>> >     -S<br>
>>>> ><br>
>>>> ><br>
>>>> >     ><br>
>>>> >     > Best regards,<br>
>>>> >     > Boris Pavlovic<br>
>>>> >     ><br>
>>>> >     > Mirantis Inc.<br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     > On Fri, Jul 19, 2013 at 11:47 PM, Sandy Walsh<br>
>>>> >     <<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a> <mailto:<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>><br>
>>>> >     > <mailto:<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a><br>
>>>> >     <mailto:<a href="mailto:sandy.walsh@rackspace.com">sandy.walsh@rackspace.com</a>>>> wrote:<br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     >     On 07/19/2013 04:25 PM, Brian Schott wrote:<br>
>>>> >     >     > I think Soren suggested this way back in Cactus to use MQ<br>
>>>> >     for compute<br>
>>>> >     >     > node state rather than database and it was a good idea then.<br>
>>>> >     ><br>
>>>> >     >     The problem with that approach was the number of queues went<br>
>>>> >     exponential<br>
>>>> >     >     as soon as you went beyond simple flavors. Add Capabilities or<br>
>>>> >     other<br>
>>>> >     >     criteria and you get an explosion of exchanges to listen to.<br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     >     > On Jul 19, 2013, at 10:52 AM, Boris Pavlovic<br>
>>>> >     <<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a> <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a>><br>
>>>> >     >     <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a> <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a>>><br>
>>>> >     >     > <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a> <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a>><br>
>>>> >     <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a> <mailto:<a href="mailto:boris@pavlovic.me">boris@pavlovic.me</a>>>>> wrote:<br>
>>>> >     >     ><br>
>>>> >     >     >> Hi all,<br>
>>>> >     >     >><br>
>>>> >     >     >><br>
>>>> >     >     >> In Mirantis Alexey Ovtchinnikov and me are working on nova<br>
>>>> >     scheduler<br>
>>>> >     >     >> improvements.<br>
>>>> >     >     >><br>
>>>> >     >     >> As far as we can see the problem, now scheduler has two<br>
>>>> >     major issues:<br>
>>>> >     >     >><br>
>>>> >     >     >> 1) Scalability. Factors that contribute to bad scalability<br>
>>>> >     are these:<br>
>>>> >     >     >> *) Each compute node every periodic task interval (60 sec<br>
>>>> >     by default)<br>
>>>> >     >     >> updates resources state in DB.<br>
>>>> >     >     >> *) On every boot request scheduler has to fetch information<br>
>>>> >     about all<br>
>>>> >     >     >> compute nodes from DB.<br>
>>>> >     >     >><br>
>>>> >     >     >> 2) Flexibility. Flexibility perishes due to problems with:<br>
>>>> >     >     >> *) Addiing new complex resources (such as big lists of complex<br>
>>>> >     >     objects<br>
>>>> >     >     >> e.g. required by PCI Passthrough<br>
>>>> >     >     >><br>
>>>> >     ><br>
>>>> >     <a href="https://review.openstack.org/#/c/34644/5/nova/db/sqlalchemy/models.py">https://review.openstack.org/#/c/34644/5/nova/db/sqlalchemy/models.py</a>)<br>
>>>> >     >     >> *) Using different sources of data in Scheduler for example<br>
>>>> >     from<br>
>>>> >     >     >> cinder or ceilometer.<br>
>>>> >     >     >> (as required by Volume Affinity Filter<br>
>>>> >     >     >> <a href="https://review.openstack.org/#/c/29343/">https://review.openstack.org/#/c/29343/</a>)<br>
>>>> >     >     >><br>
>>>> >     >     >><br>
>>>> >     >     >> We found a simple way to mitigate this issues by avoiding<br>
>>>> >     of DB usage<br>
>>>> >     >     >> for host state storage.<br>
>>>> >     >     >><br>
>>>> >     >     >> A more detailed discussion of the problem state and one of<br>
>>>> >     a possible<br>
>>>> >     >     >> solution can be found here:<br>
>>>> >     >     >><br>
>>>> >     >     >><br>
>>>> >     ><br>
>>>> >     <a href="https://docs.google.com/document/d/1_DRv7it_mwalEZzLy5WO92TJcummpmWL4NWsWf0UWiQ/edit#">https://docs.google.com/document/d/1_DRv7it_mwalEZzLy5WO92TJcummpmWL4NWsWf0UWiQ/edit#</a><br>
>>>> >     >     >><br>
>>>> >     >     >><br>
>>>> >     >     >> Best regards,<br>
>>>> >     >     >> Boris Pavlovic<br>
>>>> >     >     >><br>
>>>> >     >     >> Mirantis Inc.<br>
>>>> >     >     >><br>
>>>> >     >     >> _______________________________________________<br>
>>>> >     >     >> OpenStack-dev mailing list<br>
>>>> >     >     >> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>><br>
>>>> >     >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>>><br>
>>>> >     >     >> <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>><br>
>>>> >     >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>>>><br>
>>>> >     >     >><br>
>>>> >     <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>>> >     >     ><br>
>>>> >     >     ><br>
>>>> >     >     ><br>
>>>> >     >     > _______________________________________________<br>
>>>> >     >     > OpenStack-dev mailing list<br>
>>>> >     >     > <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>><br>
>>>> >     >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>>><br>
>>>> >     >     ><br>
>>>> >     <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>>> >     >     ><br>
>>>> >     ><br>
>>>> >     >     _______________________________________________<br>
>>>> >     >     OpenStack-dev mailing list<br>
>>>> >     >     <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>><br>
>>>> >     >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>>><br>
>>>> >     >     <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     ><br>
>>>> >     > _______________________________________________<br>
>>>> >     > OpenStack-dev mailing list<br>
>>>> >     > <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>><br>
>>>> >     > <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>>> >     ><br>
>>>> ><br>
>>>> >     _______________________________________________<br>
>>>> >     OpenStack-dev mailing list<br>
>>>> >     <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> >     <mailto:<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a>><br>
>>>> >     <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > _______________________________________________<br>
>>>> > OpenStack-dev mailing list<br>
>>>> > <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> > <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>>> ><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> OpenStack-dev mailing list<br>
>>>> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>>> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> OpenStack-dev mailing list<br>
>>> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>>> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> OpenStack-dev mailing list<br>
>> <a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
>> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
>><br>
><br>
</p>