Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-24273 Improve speed of WUListQueries. #13880

Conversation

jakesmith
Copy link
Member

@jakesmith jakesmith commented Jun 19, 2020

The cost of validating whether a query was active, by scanning
Alias' for a match when there were 1000's of queries, was very
expensive.
Build a unordered_set 1st then use that to validate if queries
are active.

Signed-off-by: Jake Smith jake.smith@lexisnexisrisk.com

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

@hpcc-jirabot
Copy link

@jakesmith
Copy link
Member Author

Local testing with an environment with ~9000 deployed queries, this speeds up the scan from approx 30 seconds, to ~ 1.1 second.

@ghalliday - please review.

@HPCCSmoketest
Copy link
Contributor

Automated Smoketest: ✅
OS: centos 7.8.2003 (Linux 3.10.0-957.1.3.el7.x86_64)
GCC: gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Host: ip-10-20-0-116.ca-central-1.compute.internal
Sha: ff81d4f
Build: success
Milestone:Install hpccsystems-platform-community_7.9.0-trunk0.el7.x86_64.rpm
HPCC Start: OK

Unit tests result:

Test total passed failed errors timeout elaps
unittest 137 137 0 0 0 74 sec
wutoolTest(Dali) 19 19 0 0 0 2 sec
wutoolTest(Cassandra) 19 19 0 0 0 8 sec

Regression test result:

phase total pass fail elaps
setup (hthor) 11 11 0 33 sec (00:00:33)
setup (thor) 11 11 0 45 sec (00:00:45)
setup (roxie) 11 11 0 20 sec (00:00:20)
test (hthor) 883 883 0 577 sec (00:09:37)
test (thor) 821 821 0 1035 sec (00:17:15)
test (roxie) 962 962 0 722 sec (00:12:02)

HPCC Stop: OK
HPCC Uninstall: OK
Time stats:

Prep time Build time Package time Install time Start time Test time Stop time Summary
12 sec (00:00:12) 1008 sec (00:16:48) 123 sec (00:02:03) 23 sec (00:00:23) 17 sec (00:00:17) 2690 sec (00:44:50) 18 sec (00:00:18) 3891 sec (01:04:51)

@richardkchapman
Copy link
Member

Should this target 7.8.x ?

@ghalliday
Copy link
Member

@jakesmith code looks good. I think it could even be considered for 7.6.x given the impact v complexity.

@jakesmith
Copy link
Member Author

could do, didn't target a point build because it's an old issue and there are other pending related issues that may not make it before 7.10, and the environment where this was seen may want to wait until then (which is not too far off).

OTH - this issue will slowdown at least Eclwatch in all environments where there's a decent number of deployed queries when using WUListQueries .. I don't know how comment it is to call from SOAPCALL ..

@richardkchapman - shall I target 7.6.x ?

@richardkchapman
Copy link
Member

@jakesmith Yes

The cost of validating whether a query was active, by scanning
Alias' for a match when there were 1000's of queries, was very
expensive.
Build a unordered_set 1st then use that to validate if queries
are active.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
@jakesmith jakesmith changed the base branch from master to candidate-7.6.x June 22, 2020 11:58
@jakesmith
Copy link
Member Author

@ghalliday @richardkchapman - rebased to 7.6.x

@HPCCSmoketest
Copy link
Contributor

Automated Smoketest: ✅
OS: centos 7.6.1810 (Linux 3.10.0-957.1.3.el7.x86_64)
GCC: gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Host: ip-10-20-0-189.ca-central-1.compute.internal
Sha: 4056e6d
Build: success
ECL Watch: Rebuilding Site
Install warning(s):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {os:darwin,arch:any} (current: {os:linux,arch:x64})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {os:darwin,arch:any} (current: {os:linux,arch:x64})

Rebuild: success
Milestone:Install hpccsystems-platform-community_7.6.53-closedown0.el7.x86_64.rpm
HPCC Start: OK

Unit tests result:

Test total passed failed errors timeout elaps
unittest 116 116 0 0 0 39 sec
wutoolTest(Dali) 19 19 0 0 0 1 sec
wutoolTest(Cassandra) 19 19 0 0 0 8 sec

Regression test result:

phase total pass fail elaps
setup (hthor) 11 11 0 27 sec (00:00:27)
setup (thor) 11 11 0 42 sec (00:00:42)
setup (roxie) 11 11 0 17 sec (00:00:17)
test (hthor) 871 871 0 306 sec (00:05:06)
test (thor) 809 809 0 701 sec (00:11:41)
test (roxie) 951 951 0 405 sec (00:06:45)

HPCC Stop: OK
HPCC Uninstall: OK
Time stats:

Prep time Build time Package time Install time Start time Test time Stop time Summary
8 sec (00:00:08) 406 sec (00:06:46) 206 sec (00:03:26) 23 sec (00:00:23) 20 sec (00:00:20) 1723 sec (00:28:43) 19 sec (00:00:19) 2405 sec (00:40:05)

@richardkchapman richardkchapman merged commit 62fac26 into hpcc-systems:candidate-7.6.x Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants