question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CPU usage is 2-6% when no browser connected

See original GitHub issue

Summary

image

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:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
schaumbcommented, Mar 10, 2021

I see in the code, that there is an async ‘busy’ loop, which runs always (with 0.01 sec delay):

  • in server.py function _loop_coroutine’s main loop.
    • self._state == State.NO_BROWSERS_CONNECTED or
    • self._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.

0reactions
schaumbcommented, Oct 13, 2021

The PR solved this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found