<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 3, 2015 at 3:20 PM, Boris Pavlovic <span dir="ltr"><<a href="mailto:boris@pavlovic.me" target="_blank">boris@pavlovic.me</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi stackers, <div><br></div><div>Usually such projects like Heat, Tempest, Rally, Scalar, and other tool that works with OpenStack are working with resources (e.g. VM, Volumes, Images, ..) in the next way: <br></div><div><br></div><div>>>> resource = api.resouce_do_some_stuff()</div><div>>>> while api.resource_get(resource["uuid"]) != expected_status</div><div>>>>    sleep(a_bit)</div><div><br></div><div>For each async operation they are polling and call many times resource_get() which creates significant load on API and DB layers due the nature of this request. (Usually getting full information about resources produces SQL requests that contains multiple JOINs, e,g for nova vm it's 6 joins). </div><div><br></div><div>What if we add new API method that will just resturn resource status by UUID? Or even just extend get request with the new argument that returns only status? </div><div><br></div><div>Thoughts?</div><div><br></div><div><br></div><div>Best regards,</div><div>Boris Pavlovic </div></div>
<br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><div class="gmail_default" style="font-family:monospace,monospace">​Hey Boris,</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">As I asked in IRC, I'm kinda curious what the difference is here in terms of API and DB calls.  I very well might be missing an idea here, but currently we do a get by ID in that loop that you mention, the only difference I see in what you're suggesting is a reduced payload maybe?  A response that only includes the status?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I may be missing an important idea here, but it seems to me that you would still have the same number of API calls and DB request, just possibly a slightly smaller payload.  Let me know if I'm missing the idea here.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Thanks,</div><div class="gmail_default" style="font-family:monospace,monospace">John​</div><br></div></div>