leapp icon indicating copy to clipboard operation
leapp copied to clipboard

High CPU Usage

Open egauk opened this issue 3 years ago • 6 comments

Describe the bug After logging into AWS SSO and with Leapp window open CPU usage is 18-20% consistent. With Leapp window minimized CPU usage drops to <1%. Also Leaap UI actions are very slow.

Leapp Version 0.13.2 (Windows)

To Reproduce Steps to reproduce the behavior:

  1. Login to AWS SSO using Leapp (I have 200+ accounts)
  2. Wait for account list to populate
  3. Open task manager with Leapp window open and notice the Leapp app high CPU usage
  4. The UI will also lag and perform poorly
  5. Minimize the Leapp window, wait ~30-seconds and the CPU usage will drop to below 1%

Expected behavior Lower CPU usage and better UI performance

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 19044.1826

egauk avatar Aug 02 '22 14:08 egauk

I think it's a side effect of closed bug #281. I'll check with @ericvilla

pethron avatar Aug 03 '22 08:08 pethron

Hi @egauk! I confirm what @pethron said. Basically, to avoid AWS throttling requests to AWS Identity Center APIs, we implemented a queue system that, as far as now, forces a maximum TPS (transactions per second) rate of 10. I think this is why you are experiencing an increased CPU usage when the integration's login or sync is in progress. Imo, to make the user aware of this state, we could introduce a spinner near the integration name; this spinner should disappear as soon as the integration-related sessions are synced. What do you think about it?

ericvilla avatar Aug 03 '22 10:08 ericvilla

This occurs after the login and sync are complete (even after several minutes) and only while the Leapp window is maximized, if minimized the issue does not exist. I still feel this is being caused by something else, but it is a good idea to start with a spinner so the user knows the status of the sync.

egauk avatar Aug 03 '22 11:08 egauk

Yeah, I agree. It is indeed strange that this behavior occurs only when the window is open (you wrote maximized, but I assume you do not intend it to be full-screen). Especially on point 5, the app resumes normal CPU usage even if not minimized after those 30 seconds, or is the minimization a hard requirement to continue regular operation?

pethron avatar Aug 03 '22 12:08 pethron

Correct, not full screen just restored/open and not minimized is when the issue occurs. On point 5 after minimizing the window and then waiting ~30-seconds the CPU usage is less than 1% with the window still minimized (it is a hard requirement). As soon as I restore/open the window CPU usage returns to 18-20%.

egauk avatar Aug 03 '22 14:08 egauk

Ok, thanks a lot for the info! We'll check!

pethron avatar Aug 03 '22 14:08 pethron

Hi @egauk! With the new v0.15.0 release we've refactored sessions list introducing recycle of views; CPU usage and memory footprint were dramatically reduced. I'll close this issue as soon as you provide us with a positive feedback

ericvilla avatar Oct 03 '22 11:10 ericvilla

Confirmed that the issue is resolved!

egauk avatar Oct 03 '22 12:10 egauk