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

High CPU usage with Atlantis turned on #862

Open
schwindt opened this issue Apr 21, 2021 · 10 comments
Open

High CPU usage with Atlantis turned on #862

schwindt opened this issue Apr 21, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@schwindt
Copy link

Proxyman version 2.23.0
macOS Version 10.15.7

Steps to reproduce

Just start Proxyman with Atlantis turned on in your xcode projekt
after some minutes, the cpu usage gets around 150%. And thats all the time.

Expected behavior

low CPU usage

@NghiaTranUIT NghiaTranUIT self-assigned this Apr 21, 2021
@NghiaTranUIT
Copy link
Member

Thanks for the report @schwindt
I have few questions:

  1. Just wondering what Atlantis version are you using?
  2. How many requests from your app that appear on Proxman when the CPU goes high? You can get the number from the ID column

I'm investigating it, but it seems that I couldn't reproduce it

@NghiaTranUIT NghiaTranUIT added the bug Something isn't working label Apr 21, 2021
@schwindt
Copy link
Author

  1. we are using Atlantis version 1.8.0
  2. current ID is at 2555. But it doesn't matter if there are any api calls. Even when there are no calls, the cpu usage is constantly high.

Maybe I could find the problem: I had to deactivate the "proxy overridden" feature (option + command + o). The CPU usage went down directly. After I activated it, the CPU usage is still low.

@NghiaTranUIT
Copy link
Member

Thanks for the input 👍

Can you check how many rules in your SSL Proxying list are? (Tool -> SSL Proxying List). I suppose that there are many requests are intercepted during this time, so you get a higher CPU.

Toggle Proxy Overridden might fix it because these connections are stopped.

@schwindt
Copy link
Author

In the include list there are just 4 entries. The exclude list is empty.

@Brontojoris
Copy link

Brontojoris commented Sep 2, 2021

I'm also seeing high CPU usage whenever I have an app running that implements Atlantis.

The app doesn't even need running in a simulator on the same machine as proxyman.

If the app with Atlantis framework is running on a device, or another Mac with simulator then the one running Poxyman has the high CPU.

System: MacBook Pro 2020, macOS 10.15.7, Proxyman 2.32.0. Xcode 12.4. Swift 5

@NghiaTranUIT
Copy link
Member

Thanks for your report @Brontojoris @schwindt

We've received a similar report with Atlantis too, but I'm not able to reproduce it in my machine.

If you don't mind, please install this version of Atlantis:

SMP

Check out this commit: 29088bc9b752498cdb74051c962855f2de77e52a

Cocoapod

pod 'atlantis-proxyman', :git => 'https://github.com/ProxymanApp/atlantis.git', :commit => '29088bc9b752498cdb74051c962855f2de77e52a'

I assume that the problem when we try to do Method Swizzling on NSConnection Delegate, so we remove it.

Please let me know if the high CPU issue remains 👍

Reference

@NghiaTranUIT
Copy link
Member

NghiaTranUIT commented Sep 2, 2021

Just wondering:

  • Are your app, which is integrated with Atlantis, is downloading/uploading a huge file when the CPU is high? 🤔

Since Atlantis intercepts the Download/Upload URL Session Task -> Encode to JSON -> Zip -> Send to Proxyman app -> It might increase the CPU usage if the data is huge enough.

@Brontojoris
Copy link

Hi @NghiaTranUIT ,

I updated my iOS app to use the specific version of atlantis, and ran it again on a seperate mac from where Proxyman is running.

After 4 or so hours of low cpu, Proxyman usage increase to between 120-140%. I disabled SSL proxying, and turned off Scripting, but CPU usage stays high. If I relaunch Proxyman, then CPU is low again.

I used Activity Monitor to capture a spin dump and a sample. Let me know if this is useful to you.

I did not see memory usage of my app running in the simulator on the other machine increase over time, like was mentioned in this issue

@hohuutuan85
Copy link

Proxyman version 2.23.0

macOS Version 10.15.7

Steps to reproduce

Just start Proxyman with Atlantis turned on in your xcode projekt

after some minutes, the cpu usage gets around 150%. And thats all the time.

Expected behavior

low CPU usage

@NghiaTranUIT
Copy link
Member

@hohuutuan85 just wondering what macOS and Atlantis version. Do you use the latest version 🤔 ?

  • Proxyman for macOS: 4.3.0
  • Atlantis: 1.20.0

and what iOS version you're using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants