Bug 1363823 - [scale] - getsnapshotbyleafguid inefficient query - query recursion
Summary: [scale] - getsnapshotbyleafguid inefficient query - query recursion
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Database.Core
Version: 4.0.2.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ovirt-4.0.4
: 4.0.4
Assignee: Allon Mureinik
QA Contact: Eldad Marciano
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-03 16:21 UTC by Eldad Marciano
Modified: 2016-09-26 12:32 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-26 12:32:18 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.0.z+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1302752 0 high CLOSED [scale] - getdisksvmguid inefficient query, hit the performance 2021-02-22 00:41:40 UTC
oVirt gerrit 62286 0 ovirt-engine-4.0 MERGED database: memory_and_disk_images_storage_domain_view 2020-02-24 07:08:11 UTC

Internal Links: 1302752

Description Eldad Marciano 2016-08-03 16:21:26 UTC
Description of problem:
in 2.4K vms scale engine generate lot of getsnapshotbyleafguid calls.
this query running high CPU utlizaion as standalone SQL.

engine profile 
2.4K vms * 3 disks = ~7K disks.


see also 
https://bugzilla.redhat.com/show_bug.cgi?id=1302752


Version-Release number of selected component (if applicable):
4.0.2-1

How reproducible:
100%

Steps to Reproduce:
1. 2.4K vms / ~7K disks


Actual results:
high CPU utilization on postgres host (90-100%)

Expected results:
stable CPU utilization & optimized query

Additional info:

Comment 3 Allon Mureinik 2016-08-08 07:33:42 UTC
Eldad, any insight on what called this? I see it in a couple of commands (which makes sense to me),  in a query that IIUC is called by some interactive dialogs and during OVF processing. 

The approach here probably won't be to optimize the query (I doubt there's TOO much we can do there without being too adventurous), but to find the offensive flow and fix it.

Comment 4 Red Hat Bugzilla Rules Engine 2016-08-08 07:34:03 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 5 Allon Mureinik 2016-08-08 08:36:06 UTC
Eldad - having said that (comment 3), I have an idea that may improve the underlying view's performance.
While the theory about it seems to be solid, I'm unable to prove it with the limited dataset I have on my env.

Could you cherry-pick it to your env, apply the change in the view and report if there's any improvement back here?

The patch:
https://gerrit.ovirt.org/#/c/62044/

Comment 6 Allon Mureinik 2016-08-08 08:50:05 UTC
(In reply to Allon Mureinik from comment #5)
> Could you cherry-pick it to your env, apply the change in the view and
> report if there's any improvement back here?
That was misphrased - the patch also adds a couple indexes - if possible, just cherry-pick it and run the database upgrade.

Comment 7 Eldad Marciano 2016-08-10 19:49:31 UTC
(In reply to Allon Mureinik from comment #6)
> (In reply to Allon Mureinik from comment #5)
> > Could you cherry-pick it to your env, apply the change in the view and
> > report if there's any improvement back here?
> That was misphrased - the patch also adds a couple indexes - if possible,
> just cherry-pick it and run the database upgrade.

verified, let merged it ASAP.
query response time ~200ms.

Comment 8 Allon Mureinik 2016-08-11 12:39:43 UTC
(In reply to Eldad Marciano from comment #7)
> (In reply to Allon Mureinik from comment #6)
> > (In reply to Allon Mureinik from comment #5)
> > > Could you cherry-pick it to your env, apply the change in the view and
> > > report if there's any improvement back here?
> > That was misphrased - the patch also adds a couple indexes - if possible,
> > just cherry-pick it and run the database upgrade.
> 
> verified, let merged it ASAP.
> query response time ~200ms.
Thanks Eldad!
I'm retargetting to 4.0.4


Note You need to log in before you can comment on or make changes to this bug.