Skip to content

High CPU usage in idle state on Intel Mac when using Python3.8 #1298

Open
@yanxurui

Description

@yanxurui

Check FAQs
Checked.

Describe the bug
I started the proxy from command line in my mac and noticed the CPU usage of the acceptor is very high even though there is zero load. Seems there is a while loop running inside the process?

To Reproduce
Steps to reproduce the behavior:

  1. clone the repo
  2. install depedencies
  3. checkout to v2.4.3
  4. python -m proxy --num-acceptors 1 --hostname 0.0.0.0 --log-level d
develop ✔ $ python -m proxy --num-acceptors 1 --hostname 0.0.0.0 --log-level d
2022-11-27 14:17:20,414 - pid:28662 [D] utils.set_open_file_limit:320 - Open file soft limit set to 1024
2022-11-27 14:17:20,415 - pid:28662 [I] plugins.load:85 - Loaded plugin proxy.http.proxy.HttpProxyPlugin
2022-11-27 14:17:20,416 - pid:28662 [I] tcp.listen:80 - Listening on 0.0.0.0:8899
2022-11-27 14:17:20,421 - pid:28662 [D] pool._start:148 - Started acceptor#0 process 28680
2022-11-27 14:17:20,423 - pid:28662 [I] pool.setup:105 - Started 1 acceptors in threadless (local) mode
2022-11-27 14:17:20,673 - pid:28680 [D] selector_events.__init__:59 - Using selector: KqueueSelector
2022-11-27 14:17:20,674 - pid:28680 [D] threadless.run:412 - Working on 0 works

Expected behavior
I expect the CPU usage of the proxy process to be very low when there is no load at all. However, the process is utilizing the entire core.

Version information

  • OS: Mac OS Monterey
  • Browser [e.g. chrome, safari]: N/A
  • Device: Mac
  • proxy.py Version: v2.4.3

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2022-11-27 at 14 18 30

Metadata

Metadata

Assignees

Labels

BugBug report in proxy server

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions