Skip to content

Improve login time - #6412

Merged
harikrishna-patnala merged 4 commits into
apache:mainfrom
scclouds:improve-slow-login
Jul 20, 2022
Merged

Improve login time#6412
harikrishna-patnala merged 4 commits into
apache:mainfrom
scclouds:improve-slow-login

Conversation

@BryanMLima

Copy link
Copy Markdown
Contributor

Description

The API listApis currently has too many redundant calls to the DB, which causes slowness on the ACS login. This PR aims to improve the time of login on ACS by refactoring the classes that implement the APIChecker interface. In my local lab, the login usually took 13 seconds, without login cache. With this new version, the login took around 2 seconds, with no login cache as well.

Fixes: #5266

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I created multiple accounts with the roles based on the following table. I compared this PR with a version with the unmodified APIChecker. And the number of APIs were returned as expected, as the table shows.

Role Type 4.16.0.6 version PR version
Root Admin 624 624
Domain Admin 180 180
Read-Only Admin 312 312
Support Admin 202 202
User 268 268

Furthermore, I tried multiple functions through the UI with these accounts, and the APIs allowed were working correctly.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm
extensive testing in unit tests, I think manual testing will still be needed, though
some questions

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6412 (SL-JID-1639)

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6412 (SL-JID-1672)

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@shwstppr shwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with a simulator env against main branch.
main
main
pr-6412
6412

shwstppr@shwstppr-ThinkPad:~/lab/shapeblue/cloudstack/ui|main 
⇒  time cmk list apis >/dev/null 2>/dev/null                                     
cmk list apis > /dev/null 2> /dev/null  0.34s user 0.04s system 10% cpu 3.569 total
shwstppr@shwstppr-ThinkPad:~/lab/shapeblue/cloudstack/ui|pr-6412 
⇒  time cmk list apis >/dev/null 2>/dev/null                          
cmk list apis > /dev/null 2> /dev/null  0.40s user 0.04s system 25% cpu 1.726 total

@apache apache deleted a comment from blueorangutan Jun 23, 2022
@apache apache deleted a comment from blueorangutan Jun 23, 2022
@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✔️ el8 ✔️ debian ✖️ suse15. SL-JID 3635

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@apache apache deleted a comment from blueorangutan Jun 27, 2022
@apache apache deleted a comment from blueorangutan Jun 27, 2022
@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 3651

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@BryanMLima

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6412 (SL-JID-1853)

@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

29.8% 29.8% Coverage
0.0% 0.0% Duplication

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✖️ suse15. SL-JID 3662

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4405)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 38333 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6412-t4405-kvm-centos7.zip
Smoke tests completed. 98 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@BryanMLima
BryanMLima requested a review from GutoVeronezi July 5, 2022 18:57
@yadvr yadvr added this to the 4.18.0.0 milestone Jul 6, 2022

@yadvr yadvr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, my only concern is other users of this API such as cmk aren't broken. Smoketests LGTM.

@yadvr

yadvr commented Jul 6, 2022

Copy link
Copy Markdown
Member

@harikrishna-patnala @Pearl1594 can you review the PR and test an env if possible. The changes are in dynamic and project roles checker where we can use your expertise.

@yadvr

yadvr commented Jul 16, 2022

Copy link
Copy Markdown
Member

This is ready for merging, asking a final review from security PoV cc @harikrishna-patnala

@yadvr yadvr closed this Jul 16, 2022
@yadvr yadvr reopened this Jul 16, 2022
@yadvr

yadvr commented Jul 16, 2022

Copy link
Copy Markdown
Member

(rekick travis against latest main)

@harikrishna-patnala harikrishna-patnala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM wrt the API checker code and tests.

@harikrishna-patnala
harikrishna-patnala merged commit 71bc088 into apache:main Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CloudStack UI login is slow

9 participants