[gsoc-dev] A Query

pranjal mittal mittal.pranjal at gmail.com
Thu Sep 5 15:13:56 UTC 2013


Hello Chance,

I made a new test_feature/13569 branch where I  have added a new view in
the ganetiviz code that returns a single view JSON  (nodes + views data
together) to reduce number of db hits as you mentioned.

[1]
https://github.com/pramttl/ganeti_webmgr/blob/test_feature/13569/ganeti_web/ganetiviz/views.py

The endpoint for this is `/ganetiviz/cluster/(cluster-slug)`

A JSON is returned now, but there seems to be a problem with this JSON. I
see a number '1'  in the primary_node field of an instance instead of a fdn
hostname, which is strange.

Here is what it looks like:
[2] http://pastebin.osuosl.org/3208/like we had discussed for the Node
model before <http://pastebin.osuosl.org/3208/>

Any idea on the problem here? Could this be some natural_key setting issue
in the VirualMachine models?



On Thu, Sep 5, 2013 at 4:41 PM, pranjal mittal <mittal.pranjal at gmail.com>wrote:

>
>
>
> On Thu, Sep 5, 2013 at 4:40 PM, pranjal mittal <mittal.pranjal at gmail.com>wrote:
>
>> Hello Chance,
>>
>> Ah, I get the point! I will prioritize working on a fix for these speed
>> issues so that there are no problems in production environments with a lot
>> of nodes and vms (data).
>>
>> Firstly I need to know whether the *speed bottleneck* really lies in the
>> fetching the data from GWM or in the rendering of the graph (Case A or B
>> mentioned ahead)
>>
>> *Case A* - Fetching JSON (which indirectly hits the database)
>> *Case B* - Javascript code responsible for rendering.
>>
>> Checking Case A - Does it take some time when you access:
>>  /ganetiviz/(cluster-slug)/vms?
>>
>> Checking case B - Does it take a time significantly different than twice
>> of Case A to generate a
>>
> (* significantly *greater* than)
>
>
>> cluster map when you hit - */map/(cluster-slug)?*
>> *
>> *
>> I would need your feedback after this code is test run on production
>> again.*
>> *
>>
>> I could create a test_feature/13569 branch which adds profiling and
>> timing to the views so that this is easier to spot the "slow code" location
>> this way?
>> OTOH, I have spotted areas where ganetiviz Javascript needs to be
>> optmized, working on that too.
>>
>>
>>
>>
>> - Pranjal
>>
>>
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Chance Zibolski <notifications at github.com>
>> Date: Wed, Sep 4, 2013 at 11:54 PM
>> Subject: Re: [ganeti_webmgr] "Ganetiviz" Cluster Visualization app added
>> - Ready for pull into "develop" (#5)
>> To: osuosl/ganeti_webmgr <ganeti_webmgr at noreply.github.com>
>> Cc: Pranjal Mittal <mittal.pranjal at gmail.com>
>>
>>
>> It reduces the number of queries to the database, because each Ajax
>> request
>> is hitting a view which does a DB query. Since all of this is pretty
>> simple
>> in terms of data, a single JSON object can easily be created from a
>> single
>> DB query. Mostly speed, because with a larger number of nodes and vms, it
>> can end up taking some time to load. We've seen this on our staging
>> server
>> with production data.
>>
>> If you want to make the JSON more modular, you can change your views from
>> DetailViews.
>>
>>
>>
>> On Wed, Sep 4, 2013 at 9:04 AM, Pranjal Mittal <notifications at github.com>wrote:
>>
>>
>> > I was thinking (on the contrary) of making JSON more modular in future
>> -
>> > Example: an endpoint /ganetiviz//vms listing the vms for the node. This
>> > should help in getting data as and when required rather than fetching a
>> > whole sea of JSON data even if its not needed.
>> > However, I do not see this ^ being immediately useful, since ganetiviz
>> > (currently) needs all that data at once; so what you suggest could be
>> > useful, but I am curioous - What is the advantage of returning only 1
>> set
>> > of JSON?
>> >
>> > —
>> > Reply to this email directly or view it on GitHub<
>> https://github.com/osuosl/ganeti_webmgr/pull/5#issuecomment-23801663>
>> > .
>> >
>>
>>>> Reply to this email directly or view it on GitHub<https://github.com/osuosl/ganeti_webmgr/pull/5#issuecomment-23812141>
>> .
>>
>>
>>
>> --
>> Best Regards,
>> Pranjal Mittal
>> B.Tech.  2014
>> Indian Institute of Technology,BHU
>> Varanasi, U.P,
>> India
>>
>> Github <http://github.com/pramttl> | LinkedIn<http://in.linkedin.com/pub/pranjal-mittal/26/660/318/>|
>> Blog <http://pranjalmittal.in>
>>
>
>
>
> --
> Best Regards,
> Pranjal Mittal
> B.Tech.  2014
> Indian Institute of Technology,BHU
> Varanasi, U.P,
> India
>
> Github <http://github.com/pramttl> | LinkedIn<http://in.linkedin.com/pub/pranjal-mittal/26/660/318/>|
> Blog <http://pranjalmittal.in>
>



-- 
Best Regards,
Pranjal Mittal
B.Tech.  2014
Indian Institute of Technology,BHU
Varanasi, U.P,
India

Github <http://github.com/pramttl> |
LinkedIn<http://in.linkedin.com/pub/pranjal-mittal/26/660/318/>|
Blog <http://pranjalmittal.in>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/gsoc-dev/attachments/20130905/e88cdb65/attachment.html>


More information about the gsoc-dev mailing list