Monday, 2017-08-28

*** shuyingy_ has joined #openstack-sahara00:23
*** shuyingy_ has quit IRC00:27
openstackgerritSiyi Luo proposed openstack/sahara-image-elements master: Update the documentation link for doc migration  https://review.openstack.org/49828100:59
*** shuyingya has joined #openstack-sahara01:24
*** shuyingya has quit IRC01:24
*** shuyingya has joined #openstack-sahara01:24
openstackgerritchao liu proposed openstack/sahara master: writing convention set to use "." to source script files  https://review.openstack.org/49822301:24
openstackgerritchao liu proposed openstack/sahara master: writing convention: do not use “-y” for package install  https://review.openstack.org/49824401:35
*** caowei has joined #openstack-sahara01:41
*** shuyingy_ has joined #openstack-sahara02:17
*** shuyingya has quit IRC02:18
*** hoonetorg has quit IRC02:43
*** hoonetorg has joined #openstack-sahara03:00
*** esikachev has joined #openstack-sahara03:55
*** esikachev has quit IRC03:59
*** links has joined #openstack-sahara04:00
*** shuyingy_ has quit IRC04:16
*** shuyingya has joined #openstack-sahara04:22
*** caowei has quit IRC05:09
*** rcernin has joined #openstack-sahara05:30
*** shuyingy_ has joined #openstack-sahara05:32
*** shuyingya has quit IRC05:35
*** caowei has joined #openstack-sahara05:43
*** esikachev has joined #openstack-sahara06:10
*** pgadiya has joined #openstack-sahara06:13
openstackgerritShangXiao proposed openstack/sahara master: [Trivialfix]Fix typos in sahara  https://review.openstack.org/49832806:35
*** pcaruana has joined #openstack-sahara06:36
openstackgerritShangXiao proposed openstack/sahara master: Replace http with https for doc links in sahara  https://review.openstack.org/49832906:46
*** anshul has joined #openstack-sahara07:11
*** zemuvier has quit IRC07:15
*** anshul has quit IRC07:20
*** tesseract has joined #openstack-sahara07:31
*** esikachev has quit IRC07:32
*** esikachev has joined #openstack-sahara07:55
*** esikachev has quit IRC07:59
*** esikachev has joined #openstack-sahara08:03
*** anshul has joined #openstack-sahara08:14
*** tosky has joined #openstack-sahara08:49
*** esikachev has quit IRC09:33
*** esikachev has joined #openstack-sahara09:38
openstackgerritAlina Nesterova proposed openstack/sahara-ci-config master: Add playbook to run Apache2  https://review.openstack.org/49000210:04
*** zemuvier has joined #openstack-sahara10:09
*** tosky has quit IRC10:21
*** tosky has joined #openstack-sahara10:43
*** jamielennox has quit IRC10:51
*** jamielennox has joined #openstack-sahara10:52
*** caowei has quit IRC10:55
*** esikachev has quit IRC11:19
*** dave-mccowan has joined #openstack-sahara11:32
*** pgadiya has quit IRC11:51
openstackgerritMerged openstack/sahara-image-elements master: Update the documentation link for doc migration  https://review.openstack.org/49828111:53
*** esikachev has joined #openstack-sahara12:08
*** dave-mccowan has quit IRC12:38
*** shuyingy_ has quit IRC12:45
*** dave-mccowan has joined #openstack-sahara12:49
*** esikachev has quit IRC13:03
*** jeremyfreudberg has joined #openstack-sahara13:04
*** lucasxu has joined #openstack-sahara13:05
openstackgerritchao liu proposed openstack/sahara master: Fix to use "." to source script files  https://review.openstack.org/49822313:24
openstackgerritchao liu proposed openstack/sahara master: writing convention: do not use “-y” for package install  https://review.openstack.org/49824413:27
openstackgerritMerged openstack/sahara-image-elements master: Allow control of image output format  https://review.openstack.org/49801213:30
*** esikachev has joined #openstack-sahara14:00
*** esikachev has quit IRC14:04
*** shuyingya has joined #openstack-sahara14:17
*** shuyingya has quit IRC14:19
*** shuyingya has joined #openstack-sahara14:19
*** links has quit IRC14:22
openstackgerritIwona Kotlarska proposed openstack/sahara master: Add export of cluster templates  https://review.openstack.org/49848414:45
*** iwonka has joined #openstack-sahara14:57
iwonkaping tellesnobrega14:58
tellesnobregaiwonka, here14:58
iwonkai have a problem with git (again...)14:58
iwonkai have two my commits on my branch14:58
iwonkaso shouldn't do git-review14:59
iwonkabut one of them is also on master (i have no idea why)14:59
iwonkaso how can i do git-review only n the newer one?14:59
iwonkathe older has already been submitted for review15:00
iwonkabut i don't have a branch to start with to make the single commit i want15:00
*** esikachev has joined #openstack-sahara15:01
tellesnobregaiwonka, ok, let me be sure I understand15:01
tellesnobregayou are working on a branch and you have two commits on it15:01
iwonkayes, one is about ngt and the second one is about ct15:02
tellesnobregaone of them are is also on master15:02
tellesnobregabut you are not working from master15:03
iwonkayes, probably my mistake, it's not merged15:03
tellesnobregaif you can you can reset master to HEAD15:04
tellesnobregayou can cut a new branch and move the new patch to this branch and do git review from it15:05
tellesnobregaalso, you can reset master to HEAD15:05
tellesnobregaand on the branch that you are working that has 2 patches15:05
*** esikachev has quit IRC15:05
tellesnobregayou can do a git rebase -i15:05
tellesnobregapick only the one that you want to submit15:05
tellesnobregaand send the patch15:05
openstackgerritMerged openstack/sahara master: Fix to use "." to source script files  https://review.openstack.org/49822315:06
openstackgerritMerged openstack/sahara master: writing convention: do not use “-y” for package install  https://review.openstack.org/49824415:06
tellesnobregaiwonka, does that make sense to you?15:07
iwonkanot exactly15:07
iwonkagit rebase says "There is no tracking information for the current branch."15:08
iwonkawhen i'm on the branch for export of ct15:08
tellesnobregadid you reset master?15:08
iwonkayes15:08
tellesnobreganow on the the branch for export of ct15:08
tellesnobregayou can do git rebase -i master15:08
iwonkagit rebase -i master?15:08
iwonkaa15:08
iwonkaokay15:08
iwonkanow i have to pick only one commit that i want?15:09
tellesnobregayes15:09
iwonkaok, it worked, thanks!15:09
tellesnobreganp15:10
tellesnobregaI have to leave for a bit now15:10
tellesnobregalunch time15:10
tellesnobregaif you have any more questions just leave them here or send them by mail15:10
tellesnobregaI will reply asap15:10
iwonkaok, thanks15:13
mnaseri have a question15:15
jeremyfreudbergmnaser - fire away15:15
mnaserdoes the sahara api do some sort of busy loop?15:16
mnaseri am trying to troubleshoot some performance issues15:16
mnaserapi requests are very slow15:16
mnaseri did some profiling, saw an sql query took 4 seconds in sqlalchemy (nothing but a select all clusters)15:16
mnaserupon doing stracing, the process was going nuts with epoll_wait non stop (on a zero timeout)15:16
mnaserthe cpu usage is relatively higher so i believe that busy loop is what is messing things up potentially15:16
mnaseri just don't know where to go from here.  a show cluster api operation takes 7 seconds right now15:17
jeremyfreudbergmnaser, sadly not my area of expertise... i would say look into oslo.service etc (although perhaps you already have). also, if it's possible to benchmark sahara-engine as well, that might be useful to narrow down something15:23
mnaseri saw some conductor code15:23
mnaseri believe that it is just pipe work for an evenutal conductor15:23
mnaserdb calls still happen in the api process?15:23
*** shuyingya has quit IRC15:29
*** links has joined #openstack-sahara15:33
jeremyfreudberghttps://bugs.launchpad.net/oslo.messaging/+bug/1518430 https://bugs.launchpad.net/mos/+bug/1380220 - you've probably already read these bugs. and I don't think that what we are seeing here is the same bug exactly, but it still might be good to know if you see different behavior on python315:38
openstackLaunchpad bug 1518430 in Ubuntu Cloud Archive kilo "liberty: ~busy loop on epoll_wait being called with zero timeout" [Medium,Fix committed]15:38
jeremyfreudbergagain, i know very little about this stuff (seems like most openstack devs take it for granted too). so doing my best to narrow things down15:38
openstackLaunchpad bug 1380220 in Mirantis OpenStack 10.0.x "OpenStack services excessively poll socket events when oslo.messaging is used" [Medium,Fix committed] - Assigned to MOS Oslo (mos-oslo)15:38
jeremyfreudberg^ mnaser15:38
mnaserjeremyfreudberg yes i actually even found a redhat fix where they did a very indepth investigation but even in the investigation after fixing it sahara was a heavy poller15:39
mnaserhttps://bugzilla.redhat.com/show_bug.cgi?id=138418315:40
openstackbugzilla.redhat.com bug 1384183 in python-oslo-messaging "busy looping on epoll_wait()" [Urgent,Closed: errata] - Assigned to jeckersb15:40
jeremyfreudbergmnaser, ok, thanks for clarifying. that is tricky then... i guess it's "good" to know (although difficult to fix) that there is something specifically in sahara15:41
jeremyfreudbergmnaser, have you benchmarked another service that uses sahara-style conductor? (I think most other services do not use something quite like that)15:42
mnaserjeremyfreudberg https://bugzilla.redhat.com/show_bug.cgi?id=1384183#c24 -- that one specificly you see there15:42
openstackbugzilla.redhat.com bug 1384183 in python-oslo-messaging "busy looping on epoll_wait()" [Urgent,Closed: errata] - Assigned to jeckersb15:42
mnaserwhat do you mean by sahara-style conductor?15:42
jeremyfreudbergmnaser, i'm not sure exactly what i mean. but i know that sahara has conductor/ folder which has to do with sqlalchemy and some oslo rpc stuff, but I was under the impression that some other openstack services do it a "different" way. but I could be confused15:45
jeremyfreudbergjust trying to think of what makes sahara service act different15:46
mnaserjeremyfreudberg nova has the nova-conductor approach15:46
jeremyfreudbergindeed it does15:47
*** pcaruana has quit IRC15:47
jeremyfreudbergand i'm guessing that the process behaves rather sanely?15:47
jeremyfreudbergah, i see on the rh bug that they saw significant improvement there15:49
mnaserjeremyfreudberg but you notice that sahar-api is still drawing 81k epoll_waits over 30s15:50
jeremyfreudbergmnaser, yes i do see that15:50
mnaseron the other hand nova api is not evne on the list, heat-engine/nova-conductor which are pretty busy usually are nowhere close15:50
mnaserso thats why im wondering there must be something15:51
*** esikachev has joined #openstack-sahara16:02
*** esikachev has quit IRC16:06
*** rcernin has quit IRC16:10
openstackgerritIwona Kotlarska proposed openstack/sahara master: Add export of cluster templates  https://review.openstack.org/49848416:20
*** jeremyfreudberg has quit IRC16:22
*** links has quit IRC16:27
*** tesseract has quit IRC16:30
openstackgerritIwona Kotlarska proposed openstack/python-saharaclient master: Add export of cluster templates  https://review.openstack.org/49852016:35
*** rcernin has joined #openstack-sahara16:48
*** ssmith has joined #openstack-sahara16:51
*** shuyingya has joined #openstack-sahara17:02
*** esikachev has joined #openstack-sahara17:03
*** shuyingya has quit IRC17:07
*** chlong has joined #openstack-sahara17:07
*** esikachev has quit IRC17:07
mnasersahara   13999 12.2  0.8 408456 246736 ?       Ss   Aug25 497:06 /usr/bin/python2 /usr/bin/sahara-engine --config-file /etc/sahara/sahara.conf17:07
mnaserthe cpu time is insane!17:07
*** jeremyfreudberg has joined #openstack-sahara17:08
tellesnobregamnaser, hey just read your question, it is very interesting and I don't believe we were aware of this issue17:08
tellesnobregathanks for bringing it up17:08
mnaserthe engine suffers the same idea so i suspect oslo service might be culprit but i dont know enough about the codebase right now17:10
mnaserill get profiling17:10
jeremyfreudbergmnaser, thanks a ton for your help and interest17:11
tellesnobregathanks mnaser17:11
tellesnobregalet me know if I can be of any help17:11
mnaseryeah, we're trying to launch it in prod and this sort of thing is a breaker, thank you :)17:11
tellesnobregajeremyfreudberg, welcome back17:11
jeremyfreudbergtellesnobrega, it's good to be back17:11
jeremyfreudbergbtw mnaser, i'm hoping you'll be at the ptg since you are (if i'm not mistaken) the incoming puppet PTL... if you happen to be around wed/thurs that week please feel free to stop by sahara room17:13
mnaserjeremyfreudberg will do so, need to palan my stuff17:14
jeremyfreudbergcool17:14
openstackgerritIwona Kotlarska proposed openstack/sahara master: Add export of cluster templates  https://review.openstack.org/49848417:28
tellesnobregajeremyfreudberg, did you have a chance to read last meeting's log?17:40
jeremyfreudbergtellesnobrega, i did, but quickly17:41
tellesnobregajeremyfreudberg, shu yingya described a problem with scale cluster after updating the cluster name17:43
toskyand he added some comments about it17:43
toskyin the bug17:43
toskyit's the change in the heat template17:43
toskyin the name17:43
tellesnobregaI tried it on a devstack locally17:44
tellesnobregaand it worked17:44
jeremyfreudbergi can try soon to attempt to replicate the bug17:46
tellesnobregajeremyfreudberg, please do, that was where I wanted to get17:55
tellesnobregaI couldn't replicate here with storm17:55
jeremyfreudbergi'll try it on a few plugins, i guess (shu yingya said vanilla and storm only, but let's be sure)17:57
tellesnobregasure17:59
*** esikachev has joined #openstack-sahara18:04
*** esikachev has quit IRC18:08
*** zemuvier has quit IRC18:22
*** zemuvier has joined #openstack-sahara18:23
mnaserjeremyfreudberg tellesnobrega do you know if its possible to run the flask app only somehow with sahara?18:36
mnaserim trying to see if i can make use of the werkzeug profiler18:37
tellesnobregamnaser, did you try this sahara-venv/bin/sahara-api --config-file sahara-venv/etc/sahara.conf ?18:38
tellesnobregasahara-venv/bin/sahara-engine --config-file sahara-venv/etc/sahara.conf18:38
mnasertellesnobrega i can do that bu tthat would start up the service using oslo.service rather than just running teh sahara-api flask app directly18:38
tellesnobregahum18:38
mnaserif i can run the sahara-api app alone and there is no crazy cpu usage18:38
tellesnobregaI see18:38
jeremyfreudberghttps://github.com/openstack/sahara/blob/4439daca6de49430ad6d4a5b295e94a7eb4acf72/sahara/api/middleware/sahara_middleware.py#L3118:38
mnaseri can at least know that it's a oslo.service thing18:38
jeremyfreudbergwrite something that imports from the linked file?18:39
mnaserok thats a good start, im using this as reference http://www.alexandrejoseph.com/blog/2015-12-17-profiling-werkzeug-flask-app.html18:39
mnaserPATH: '/v1.1/8ffa97d00b9a4f55a5f4f40a5a05b600/clusters/4961ff69-a2f9-40a3-b44c-ff208ce5ca51'18:47
mnaser         8433826 function calls (8321676 primitive calls) in 9.983 seconds18:47
mnaserdamn18:47
tellesnobregathats only sahara-api?18:48
mnaserthats one GET call18:48
mnaserto get a clsuter18:48
tellesnobregathats a lot18:48
mnasergetting a clsuter template is 70k calls18:48
mnaserso something is wrong18:48
mnaserhttp://paste.openstack.org/show/619664/18:49
mnaserthere seems to be some weird stuff going on18:50
mnaserwith the pymysql # of calls18:50
mnaserhttp://paste.openstack.org/show/619665/18:50
mnaserthats a get clsuter template18:50
*** esikachev has joined #openstack-sahara18:52
tellesnobregamnaser, it is weird the number of sqlalchemy calls ther18:52
tellesnobregathere18:52
tellesnobregahow long is this taking?18:53
mnaser9.983 seconds according to that profile for that query18:54
mnaser0.133 to get a clsuter template18:54
tellesnobregacluster_template seems like it should be ok18:55
mnaser_read_row_from_packet is called 8 times in in clsuter template18:55
tellesnobregaget cluster not so much18:55
openstackgerritIwona Kotlarska proposed openstack/sahara master: Add export of cluster templates  https://review.openstack.org/49848418:55
mnaser4682 times in get clsuter18:55
tellesnobregayeah, that is not right18:56
tellesnobregaread_length_coded_string is called 698922 on get cluster and 1292 on get_cluster_template18:57
mnasertellesnobrega i think that's actually just an indirect effect of the bad _read_row_from_packet18:58
mnaserthe number scales linearly so it seems fine18:58
tellesnobregayeah, I was doing the math here18:58
mnaserso the thing that inflates it seem to be _read_row_from_packet tellesnobrega which show sthe big cumtime too18:58
tellesnobregamnaser, true.19:00
mnaser        2    0.000    0.000    9.966    4.983 /usr/lib/python2.7/site-packages/sahara/db/sqlalchemy/api.py:284(_cluster_get)19:00
mnaserdef in the sqlalchemy layer19:00
*** tellesnobrega has left #openstack-sahara19:01
*** tellesnobrega has joined #openstack-sahara19:01
mnaseri considered that it is a badly written query but i mean19:03
mnaserthere's almost no rows19:03
mnasereven no indexes no way that can take long19:03
*** jeremyfreudberg_ has joined #openstack-sahara19:04
tellesnobregamnaser, yeah, I don't see where this could be badly written19:04
*** jeremyfreudberg has quit IRC19:07
mnaser        4    0.000    0.000    8.947    2.237 /usr/lib/python2.7/site-packages/pymysql/connections.py:1379(_read_result_packet)19:07
mnaserthats called 4 times regardless19:08
mnaserbut takes 8 seconds in the cluster get19:08
mnaser_read_result_packet in turn calls read_length_encoded_integer in it19:09
mnaserwhich is called ~924k times in the slow request19:09
mnaserbut only 28219:09
* jeremyfreudberg_ jeremyfreudberg19:14
jeremyfreudberg_oops19:14
*** jeremyfreudberg_ is now known as jeremyfreudberg19:14
openstackgerritIwona Kotlarska proposed openstack/python-saharaclient master: Add import of Cluster Templates  https://review.openstack.org/49857419:21
tellesnobregamnaser, thanks for digging this. I will try to take a look in more detail19:22
tellesnobregaand if you find anything let me know19:22
mnasertellesnobrega yeah ill keep diggin19:23
tellesnobregamnaser, btw to start only sahara you did as jeremyfreudberg suggested? imported sahara_middleware and started it?19:28
mnasertellesnobrega nope i edited the file jeremyfreudberg mentioned following the instructions of the article i had there and launched it in foreground (profiling info goes in stderr)19:28
tellesnobregacool19:29
openstackgerritIwona Kotlarska proposed openstack/python-saharaclient master: Add export of cluster templates  https://review.openstack.org/49852019:31
iwonkatellesnobrega: alll that's left is dealing with ct in gui19:32
iwonkai have export ready19:32
tellesnobregathat is awesome iwonka19:32
iwonkabut about one old commit19:32
iwonkajeremyfreudberg asked to do rebase19:33
iwonkaand i did it19:33
iwonkaand now it got this problem19:33
iwonkaPatch in Merge Conflict19:33
jeremyfreudbergiwonka, yes, now it's a trickier rebase19:33
jeremyfreudbergone that cannot be done from ui :(19:33
iwonkauhh19:33
tellesnobregaiwonka, you will have to do the following19:34
tellesnobregacut a branch from master19:34
tellesnobregaand checkout that change into that branch19:34
tellesnobregafix conflict19:34
tellesnobregaand send the review19:34
jeremyfreudberghttps://www.entropywins.wtf/blog/2013/07/01/resolving-a-merge-conflict-on-gerrit/19:34
jeremyfreudbergbasically what tellesnobrega said19:34
jeremyfreudbergi do a fresh clone folder, then `git review -d <patch number>` then do rebase stuff19:34
jeremyfreudbergand by "rebase stuff" i mean conflict resolution19:35
tellesnobregaworks as well19:35
iwonkaok, i'll try to fix that, thanks19:35
*** anshul has quit IRC19:37
openstackgerritLuigi Toscano proposed openstack/python-saharaclient master: Reorganize the documentation following the new structure  https://review.openstack.org/49858019:39
iwonkaokay, the confilict was with version of oslo.log19:45
mnaserok so19:45
mnaserthe query to get a specific cluster19:45
iwonkacan I just take the bigger one and it will be fine?19:45
mnaserhas 10 joins in it.19:46
mnaserand for a single cluster get it returns 2340 rows.19:46
jeremyfreudbergiwonka, yes take the later one, but that shouldn't even be a conflict since i don't think you had a patch which also changed that file19:46
mnaserhttp://paste.openstack.org/show/619676/19:46
jeremyfreudbergiwonka, or let me rephrase that, i'm surprised it was a conflict that could not be resolved automatically19:48
jeremyfreudbergbecuase your change to requirements.txt was a different line19:48
jeremyfreudbergregardless, just take the newer version19:48
jeremyfreudbergmnaser, looking19:48
mnaseri think that was the query when you request progress/steps/whatever that query request19:48
mnaserthere's so much data sent over the line19:49
mnasermgmt private key * 200 times19:49
mnaser2000*19:49
jeremyfreudbergmnaser, this is a little scary to look at...19:49
mnaserjeremyfreudberg i just hit ctrl+f LEFT JOIN19:49
mnaserdidnt even want to haha19:49
openstackgerritIwona Kotlarska proposed openstack/sahara-dashboard master: Add export of node group templates  https://review.openstack.org/48521519:51
iwonkaok, i think i fixed it19:51
jeremyfreudbergiwonka, looks like it19:51
iwonkacool19:52
iwonkathanks for help19:52
*** anshul has joined #openstack-sahara19:52
jeremyfreudbergso mnaser, where do we go from here? what's the road to optimization?19:55
mnaserjeremyfreudberg i think this is a case of "lets make one single query to make it super optimized"19:56
mnaserbut ending up with something even less optimized19:56
jeremyfreudbergmnaser, i'm not super familiar with sqlalchemy - how do we make the query "not weird" again, is really what i mean. or how do we wrangle sqlalchemy into being smarter/dumber in the queries it constructs19:59
mnaserjeremyfreudberg thats what im trying to figure out.  it seems to carry a lot of info that is not used20:00
jeremyfreudbergmnaser, i guess my other question is do we see these kinds of underlying queries with another services as well (like nova, etc).20:03
jeremyfreudbergI can look into this at some point too20:03
mnaserjeremyfreudberg i think the problem is like the fact there is such huge fields20:03
mnaserlike describe clusters;20:05
mnaseryou got all those giant TEXT fields20:05
mnaserfor mgmt keys and stuff20:05
jeremyfreudbergmnaser, that's true, but also nova has some mediumtext fields, and i'm sure other services use fields like that too. so that can't be the whole story20:08
mnaseri feel like its a bit of a contributing factor as well, i am trying to see how much data we're sending on the line20:09
jeremyfreudbergyes, i'm sure it has some impact, but just not all the impact20:10
mnaserjeremyfreudberg small math20:13
mnaserthat query generates 12521818 bytes of data20:13
mnaseraka 12.52 megabytes20:13
mnaserthat's 12.5 megabytes of data being parsed on every cluster get call20:13
jeremyfreudbergmnaser, how can i play around with these myself - is it from werkzeug profiler, something else ...? I might have missed that. but yeah, 12.5 megs is too much.20:15
tellesnobregamnaser, that is too much20:17
mnaserjeremyfreudberg next gen debugging... loop spamming 'show full processlist' in shell20:18
mnaserwhile hitting the api20:18
mnaser:p20:18
mnaserthats how i got that SQL query20:18
mnaserhttps://github.com/openstack/sahara/blob/master/sahara/db/sqlalchemy/models.py#L71-L8220:23
mnaserlazy='joined' is the culprit here i think20:23
mnaserim gonna see the nova db code20:24
jeremyfreudbergmnaser, pretty interesting that the change was orignally done without explanation too https://review.openstack.org/#/c/4039120:26
jeremyfreudbergthat's always "nice"20:26
mnaseryep just saw the git blame too..20:27
mnaserjeremyfreudberg spoke with nova folks20:28
mnaser0 implicit joins in the nova code base, only explicit joins20:29
mnaserlet me try removing the joins and seeing what sort of performance i end up with20:29
mnaser(the code will still work, it will just generate an extra query if it needs it)20:29
jeremyfreudbergcool20:30
mnaseroh god20:33
mnaserthis is messy20:33
mnaserjeremyfreudberg the reason behind the joins is the to_dict code stuff20:33
mnaserwould resolve all of them20:33
jeremyfreudbergmnaser, oh20:37
mnaserDetachedInstanceError: Parent instance <Cluster at 0x8a562d0> is not bound to a Session; lazy load operation of attribute 'node_groups' cannot proceed20:37
mnasergetting this when removing the join20:37
toskyuhm, so the join is needed maybe to retrive that attribute?20:39
toskyI know about SQL but I really don't know about sqlalchemy20:39
mnasertosky sqlalchemy can do a join to prepopulate data20:41
mnaseralterantively it can avoid doing that and automatically make a select when that attribute is called20:41
mnaserthe current behaviour loads everything and sends all the data across from the db layer back20:41
toskyargh20:41
mnaserright now if we disable that lazyload20:41
mnaserthose fields wont be loaded on the query20:41
toskyapart from normalization, the first thing that you learn in SQL is: filter first, then join and sort20:42
mnaserand when they are passed to the conductor20:42
mnaserthey become 'detached' as in ... the conductor doesnt know that they're anything but dicts.20:42
mnaserwe had 11 joins.20:42
mnaserin the cluster_get20:42
toskyisn't it possible to filter the unneeded data first?20:42
mnaserhttp://paste.openstack.org/show/619676/ which returns 12.5 mb20:43
mnaseri mean i think the issue comes from the fact that there are huge fields being repeated20:43
mnaserfor example the mgmt private key20:43
mnaserthat query returns 2500 records on this small empty dev env20:43
mnaseri think this would be quite the refactor gr20:43
mnaserto pretty much remove all the joins and the db layer returns specific things20:44
mnaseror migrate to https://docs.openstack.org/oslo.versionedobjects/latest/20:44
toskyor leave the join, but filtered first20:44
mnasereven if its filtered, because the join creates more rows, the data gets multiplied20:44
toskyshouldn't that depend on the type of the join?20:45
*** anshul has quit IRC20:45
mnaseri think it was all left outer joins it was doing20:45
mnaserideally i think the clsuter_get should give you a cluster, nothing more, nothing less.20:45
mnaseri want to see how nova does this20:45
*** lucasxu has quit IRC20:46
*** esikachev has quit IRC20:46
*** jeremyfreudberg has quit IRC20:48
mnaserhttps://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L1943-L196120:49
mnaserdeally20:49
mnaserideally20:49
mnaserthis is what we should be doing20:49
mnaserexplicit joins on demand20:49
*** chlong has quit IRC20:53
tellesnobregamnaser, that sounds like quite a work and probably should be done soon21:12
mnasertellesnobrega yeah.  i think ill pick it up.  it shouldn't be too hard21:13
mnaserjust moving the logic21:13
tellesnobregamnaser, awesome21:13
tellesnobregalet me know if I can be of any assistance21:13
mnasertellesnobrega thanks21:14
mnaserhopefully the unit tests help21:14
*** chlong has joined #openstack-sahara21:26
*** chlong has quit IRC21:31
*** rcernin has quit IRC21:32
*** chlong has joined #openstack-sahara21:43
*** ssmith has quit IRC21:51
openstackgerritMohammed Naser proposed openstack/sahara master: Stop unnecessary joins and prefer lazy loading  https://review.openstack.org/49861122:27
mnaserstep #1 ^22:27
openstackgerritIwona Kotlarska proposed openstack/sahara-dashboard master: Add export of cluster templates to UI  https://review.openstack.org/49861222:31
*** iwonka_ has joined #openstack-sahara22:47
*** iwonka has quit IRC22:47
mnaserwoo22:53
mnaserwith that patch22:53
mnasera clsuter get22:53
mnaser3242182 function calls (3188882 primitive calls) in 4.226 seconds22:53
mnaserdown from 843382622:53
*** iwonka has joined #openstack-sahara22:53
*** iwonka_ has quit IRC22:57
mnaserwent from 2500 rows to 78022:57
mnaser4 less joins22:57
toskywow23:00
toskyand apparently no changes in features?23:00
mnasertosky yep.  if it needs to make the query, it'll just make one extra query23:04
mnaserim working on figuring out the best way for the second one now23:05
*** tosky has quit IRC23:30
*** chlong has quit IRC23:34

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!