Skip to content

Speed up and restore host history

Ian Jackson xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13sg-report-host-history: Improve debugging outputsg-report-host-history+10 -20 replies
2/13sg-report-host-history: New --no-install option for testingsg-report-host-history+5 -10 replies
3/13sg-report-host-history: Move `computeflightsrange' after hostssg-report-host-history+4 -40 replies
4/13sg-report-host-history: Actually honour $minflightsg-report-host-history+4 -10 replies
5/13sg-report-host-history: Get job status from mainquerysg-report-host-history+4 -40 replies
6/13sg-report-host-history: Add $cachekey argument to jobquerysg-report-host-history+5 -40 replies
7/13sg-report-host-history: Store per-job query results in %$jrsg-report-host-history+21 -30 replies
8/13sg-report-host-history: Write cache entriessg-report-host-history+23 -00 replies
9/13sg-report-host-history: Write cache entries for tail, toosg-report-host-history+6 -10 replies
10/13sg-report-host-history: Read cache entriessg-report-host-history+56 -10 replies
11/13sg-report-host-history: Move job runvars query latersg-report-host-history+12 -90 replies
12/13sg-report-host-history: Cache runvar queries (power information)sg-report-host-history+13 -20 replies
13/13Revert "sg-report-host-history: Reduce limit from 2000 to 200"sg-report-host-history+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Xen-devel] [OSSTEST PATCH 00/13] Speed up and restore host history

Earlier this week we discovered that sg-report-host-history was running extremely slowly. We applied an emergency fix 0fa72b13f5af
sg-report-host-history: Reduce limit from 2000 to 200

The main problem is that sg-report-host-history runs once for each flight, and must generate a relevant history view of the recent history for each host - including much history that is already in the old version of the html file.

The slow part is asking the database about information about each job, including its final step, allocation step, etc. (The main query which digs out relevant jobs is also rather time consuming it runs all in one go and takes only a minute or two.)

In this series we introduce a mechanism which caches much of the historical analysis.

It is not straightforward to reuse old html data as-is because we would have to do a merge sort with the new data and that would involve rewriting the alternating background colour (!)

So instead, we stuff the information we got from the database into comments in the HTML, which we can then scan on future runs.

The overall result is a factor of 10 speedup in my tests, for the original history limit of 2000. That is now fast enough we can put it back.

(I was not able to reproduce the exceptional case I saw earlier in the week, where it was apparently taking hours. I suspect that there comes a tipping point where db transactions end up being restarted.)

The patches are broken down into small pieces so that I could think about them clearly and do self-review.

Ian Jackson (13):
sg-report-host-history: Improve debugging output
sg-report-host-history: New --no-install option for testing
sg-report-host-history: Move `computeflightsrange' after hosts
sg-report-host-history: Actually honour $minflight
sg-report-host-history: Get job status from mainquery
sg-report-host-history: Add $cachekey argument to jobquery
sg-report-host-history: Store per-job query results in %$jr
sg-report-host-history: Write cache entries
sg-report-host-history: Write cache entries for tail, too
sg-report-host-history: Read cache entries
sg-report-host-history: Move job runvars query later
sg-report-host-history: Cache runvar queries (power information) Revert "sg-report-host-history: Reduce limit from 2000 to 200"

 sg-report-host-history | 189 +++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 160 insertions(+), 29 deletions(-)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel