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

server process high CPU usage with no active connections #5

Closed
dlarue opened this issue Jan 27, 2016 · 3 comments
Closed

server process high CPU usage with no active connections #5

dlarue opened this issue Jan 27, 2016 · 3 comments

Comments

@dlarue
Copy link

dlarue commented Jan 27, 2016

I noticed a high CPU usage with a client open but no action happening(home screen). Even after I shut down the client window there was no change in the CPU utilization of the fabscanpi-server process. The CPU chip was warm to the touch.

@theouf
Copy link

theouf commented Mar 11, 2016

Hello,
I've got the same issue. I use the fabscanpi_basic_jessie_2016-02-27-01-12.img image. Do you find why ? it's strange to use more than 90% of CPU in waiting state.

@mariolukas
Copy link
Owner

Not yet. But i have an idea and i am working on that.

@mariolukas
Copy link
Owner

The problem is that the stream is kept open, because most browsers do not stop mjpeg streaming until the whole window loading is stopped, by reloading the browser window or calling window.stop(). The stop() function is not a good solution, because it works just in chrome. In Firefox the web socket connection is killed by calling window.stop()

Fixed some threading things, and found out that this bug is related to #2 . Finally i found a workaround for #2 and #5 by adding an directive for mjpeg, which opens mjepeg stream in an iframe. When the settings dialog is closed, the iframe is destroyed and the mjpeg stream is forced to close. It is very ugly but it works, until mjpeg bugs in several browsers are fixed.
I will give it some more tests and add it to the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants