CPU usage is 2-6% when no browser connected
See original GitHub issueSummary
Steps to reproduce
Code snippet:
> cat ize.py # this file is empty
> streamlit run ize.py
...
1.) close browser which initially opens 2.) watch cpu usage
Expected behavior:
No cpu usage when no connection to streamlit
Actual behavior:
cpu usage is higher than expected
Is this a regression?
no
Debug info
- Streamlit version: Streamlit, version 0.75.0
- Python version: Python 3.6.9
- Using Conda? PipEnv? PyEnv? Pex? - No
- OS version: Linux Mint 19.2 Tina
- Browser version: Firefox 86.0 (64-bit)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
High CPU Usage (Not on windows processes) but on web ...
It sounds like you have a concern on high CPU usage. So far as I know, it's a normal condition that when we...
Read more >How to Stop Chrome From Using All Your CPU - Techstacker
One of the most common reasons for high CPU usage in Chrome is related to the amount and the type of Chrome Extensions...
Read more >high CPU usage, even with no tabs opened - Mozilla Support
Hi Firefox start to take a lot of CPU depending on how many tabs are opened (that is normal of course especially if...
Read more >How To FIX High CPU Usage on Windows 10 - YouTube
Your browser can't play this video. Learn more.
Read more >High CPU usage, even without a real reason - Ask Ubuntu
I see Chromium browser which is responsible for high CPU as per screenshot provided of htop command. That simply means there is something ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see in the code, that there is an async ‘busy’ loop, which runs always (with 0.01 sec delay):
server.py
function_loop_coroutine
’s main loop.self._state == State.NO_BROWSERS_CONNECTED
orself._state == State.WAITING_FOR_FIRST_BROWSER
This can be fixed with that set an event for the newly connection, and wait for that.This cause it, and I have a fix for that.
The PR solved this.