Bug 1149701 - [scale] scheduling on large scale setup running too long, impact on single start vm
Summary: [scale] scheduling on large scale setup running too long, impact on single st...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.4.1-1
Hardware: x86_64
OS: Unspecified
high
high
Target Milestone: ovirt-3.6.8
: ---
Assignee: Roman Mohr
QA Contact: Eldad Marciano
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-06 13:39 UTC by Eldad Marciano
Modified: 2016-07-27 14:11 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 14:11:44 UTC
oVirt Team: SLA
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
224 hosts, start 50 vms unpatched (142.64 KB, image/png)
2016-02-17 15:33 UTC, Roman Mohr
no flags Details
324 host, start 50 VMs unpatched (146.44 KB, image/png)
2016-02-17 15:34 UTC, Roman Mohr
no flags Details
324 hosts, start 50 VMs with patch 53644 (147.15 KB, image/png)
2016-02-17 15:35 UTC, Roman Mohr
no flags Details
Start 50 VMs, 10 in parallel, 300 hosts, no fix (193.44 KB, image/png)
2016-03-15 10:20 UTC, Roman Mohr
no flags Details
Start 50 VMs, 10 in parallel, 300 hosts, fix 53644 (199.11 KB, image/png)
2016-03-15 10:21 UTC, Roman Mohr
no flags Details
Start 50 VMs, 10 in parallel, 300 hosts, fixes 53644, 54720 (169.93 KB, image/png)
2016-03-15 10:22 UTC, Roman Mohr
no flags Details
Start 50 VMs, ALL in parallel, 300 hosts, fixes 53644, 54720 (169.93 KB, image/png)
2016-03-15 10:41 UTC, Roman Mohr
no flags Details
Start 50 VMs, 10 in parallel, 300 hosts, fixes 53644, 54720 (168.44 KB, image/png)
2016-03-15 11:53 UTC, Roman Mohr
no flags Details
Start 50 VMs, SEQUENTIAL, 300 hosts, fixes 53644, 54720 (166.88 KB, image/png)
2016-03-15 12:19 UTC, Roman Mohr
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1507 0 normal SHIPPED_LIVE Red Hat Enterprise Virtualization Manager (rhevm) bug fix 3.6.8 2016-07-27 18:10:22 UTC
oVirt gerrit 53644 0 master MERGED scheduler: Provide cluster to score and filter methods 2016-04-18 10:40:00 UTC
oVirt gerrit 58444 0 ovirt-engine-3.6 MERGED scheduler: Provide cluster to score and filter methods 2016-06-07 13:46:09 UTC

Description Eldad Marciano 2014-10-06 13:39:02 UTC
Description of problem:
in part of start vm investigation, the longest method which taking too long is 
getVdsToRunOn() = SchedulingManager.schedule() (see the breakdown tree)
getVdsToRunOn() run 39 seconds in large scale setup.

pre load some of the maps or using different query in order to get smaller maps or lists to runs the filters on, may enhance the performance.

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

How reproducible:
100%

Steps to Reproduce:
1. 500 hosts 10K vms setup
2. single start vm runs ~80 sec (using vdsmfake)


Actual results:
getVdsToRunOn running time ~30+ sec.

Expected results:
faster results less then few seconds.

Additional info:
RunVmCommand hotspot

Comment 1 Doron Fediuck 2014-10-07 14:32:13 UTC
Eldad,
can you please specify which scheduling policy did you use and if it was a default one or something you created?

Comment 2 Eldad Marciano 2014-10-07 14:50:55 UTC
schedule policy 'Evenly Distributed' (default).

Comment 3 Gilad Chaplik 2014-10-07 15:18:28 UTC
there is a problem running any query to the DB in his env. the scheduling process simply has many queries, that's why it takes too long.

Comment 4 Eldad Marciano 2014-10-08 06:58:17 UTC
We are monitor db queries which longer then 3 sec currently there is just 1 function which takes long and its getdisckvmguid
Is related to scheduling?

what are the queries  scheduling runs?

Comment 5 Eldad Marciano 2014-10-12 10:13:20 UTC
Gilad as we chat offline,
the following store proc 'getVdsForVdsGroupWithStatus' is not the problem.

store procedure run time is 20 millie second's.

Comment 7 Doron Fediuck 2015-08-10 11:13:48 UTC
Since several things have changed, I suggest we revisit this for 3.6.

Comment 13 Roman Mohr 2016-02-17 15:33:52 UTC
Created attachment 1127964 [details]
224 hosts, start 50 vms unpatched

Comment 14 Roman Mohr 2016-02-17 15:34:29 UTC
Created attachment 1127965 [details]
324 host, start 50 VMs unpatched

Comment 15 Roman Mohr 2016-02-17 15:35:40 UTC
Created attachment 1127966 [details]
324 hosts, start 50 VMs with patch 53644

Comment 16 Roman Mohr 2016-03-15 10:20:43 UTC
Created attachment 1136501 [details]
Start 50 VMs, 10 in parallel, 300 hosts, no fix

Comment 17 Roman Mohr 2016-03-15 10:21:33 UTC
Created attachment 1136502 [details]
Start 50 VMs, 10 in parallel, 300 hosts, fix 53644

Comment 18 Roman Mohr 2016-03-15 10:22:31 UTC
Created attachment 1136503 [details]
Start 50 VMs, 10 in parallel, 300 hosts, fixes 53644, 54720

Comment 19 Roman Mohr 2016-03-15 10:41:06 UTC
Created attachment 1136521 [details]
Start 50 VMs, ALL in parallel, 300 hosts, fixes 53644, 54720

Comment 20 Roman Mohr 2016-03-15 11:53:43 UTC
Created attachment 1136562 [details]
Start 50 VMs, 10 in parallel, 300 hosts, fixes 53644, 54720

Comment 21 Roman Mohr 2016-03-15 12:19:11 UTC
Created attachment 1136578 [details]
Start 50 VMs, SEQUENTIAL, 300 hosts, fixes 53644, 54720

Comment 22 Roy Golan 2016-04-17 08:22:17 UTC
Roman lets summarise this, your fixes are improving the critical section of the schedule() method. We need to merge this. If your finding is that the call to VdsBrokerCommands, namely comminication with VDS is slow because of ovirt-fakevdsm then we will all the fixes above mentioned and move to MOD. Any other issues on will require new bug.

Comment 23 Roy Golan 2016-04-21 06:59:03 UTC
the query outside of the lock needs bit more attention. postponing to 3.6.7.

Comment 28 Roman Mohr 2016-05-18 12:13:20 UTC
Here are the final results:

1) NO FIX APPLIED: 300 hosts, 50 VMs need to be scheduled, max. 10 in parallel

The image in [3] shows:
Mean execution time: 8.8 seconds
Median execution time: 9 seconds
99th percentile: 16 seconds
Request rate for the whole RunVmCommand: 0.7 requests/second

When we calculate the execution time without the mutex wait time we get an average execution time of 1.24 seconds which is about 0.8 requests per second. In [3] we see that we had an overall throughput of 0.7 requests/second. The two request rates are pretty close so it is hard to tell in this scenario if the scheduler is the bottleneck. We will see that it is not when we apply the first patch [1].

2) FIX [1] APPLIED: 300 hosts, 50 VMs need to be scheduled, max. 10 in parallel

Image [4] shows:
Mean execution time: 2.7 seconds
Median execution time: 2.6 seconds
99th percentile: 6 seconds
Request rate for the whole RunVmCommand: 0.7 requests/second

When we calculate the execution time without the mutex wait time we get an average execution time of 0.38 seconds which is about 2.6 requests per second. The overall request rate for the  RunVmCommand is still 0.7 requests/second. This proves that the scheduler can't be the bottleneck.

3) FIX [1] AND [2] APPLIED: 300 hosts, 50 VMs need to be scheduled,
max. 10 in parallel

Image [4] shows:
Mean execution time: 0.92 seconds
Median execution time: 0.86 seconds
99th percentile: 2.21 seconds
Request rate for the whole RunVmCommand: 0.7 requests/second

Here with the mutex wait time excluded, the average execution time is 0.13 seconds which is about 7.7 requests per second. The overall request rate for the  RunVmCommand is still 0.7 requests/second.

To sum it up, with the already merged patch [1] the scheduler is about 4 times faster and we remove some DB call loops. With [2] applied it is about 10 times faster but it also requires some architectural changes which are too risky for 3.6 from my perspective.

Even when the scheduler was 10 times faster we always had a throughput of 0.7 requests/second which proofs that the scheduler is not the cause of the problem. 

[1] http://gerrit.ovirt.org/54720
[2] http://gerrit.ovirt.org/53644
[3] https://bugzilla.redhat.com/attachment.cgi?id=1136501
[4] https://bugzilla.redhat.com/attachment.cgi?id=1136502

Comment 30 Eldad Marciano 2016-07-18 13:51:19 UTC
verified on top of 3.6.8 500 hosts with 9.9K vms.

timing:
2016-07-18 09:45:49,694 INFO  [org.ovirt.engine.core.bll.RunVmCommand] (ajp-/127.0.0.1:8702-43) [9654d5f] Lock Acquired to object 'EngineLock:{exclusiveLocks='[fbe5b76d-7de8-4f24-b232-d0f764302ed9=<VM, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}'

2016-07-18 09:45:58,228 INFO  [org.ovirt.engine.core.bll.RunVmCommand] (org.ovirt.thread.pool-6-thread-45) [9654d5f] Lock freed to object 'EngineLock:{exclusiveLocks='[fbe5b76d-7de8-4f24-b232-d0f764302ed9=<VM, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}'


seems like 10 times faster.

seems like we can speed it up even more with:
https://gerrit.ovirt.org/#/c/54720/

Comment 32 errata-xmlrpc 2016-07-27 14:11:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-1507.html


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