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

cpu reachs 100% #5

Closed
recrunchi opened this issue Feb 10, 2016 · 3 comments
Closed

cpu reachs 100% #5

recrunchi opened this issue Feb 10, 2016 · 3 comments

Comments

@recrunchi
Copy link

Hi !

I'm experiencing 100% usage of cpu by sshttp process (debian7 - kernel 4.1.16-v7+ armv7l raspberry pi2 900mhz cpu). It happens when i stream media over https (sshttp routing).

How can i debug it or increment the type of logging ?

Thanks.
Sergio.

@stealth
Copy link
Owner

stealth commented Feb 11, 2016

Thats perfectly legit if you hammer sshttp with a lot of packets like in media streaming.
The kernel scheduler would dedicate all CPU ressources to it, unless you run
some other computation-intense process on the same core. So thats OK. It should drop to
0% again if no more packets are seen (I guess the streaming works fine). If you have a lot of streams, you could also use -n switch if your pi has multiple cores.

@stealth stealth closed this as completed Feb 11, 2016
@recrunchi
Copy link
Author

Thanks, i understand. I was suspecting what you said.

So, my raspberry 2 has 4 cores. About the "-n" switch , where do i put it ? maybe at the end of the following line on /etc/init.d/sshttp ?

DAEMON_ARGS="-S $SSH_PORT -H $HTTP_PORT -L $LISTEN_PORT -U $USER -R $CHROOT -n 4"

Reading your readme.md: "Unless -n 1 is used as switch, sshttpd binds one thread per CPU core, to better exploit the hardware if running on heavily used web servers", i understand that the program actually works with 4 cores if i don't specify the "-n" switch...

thank

@stealth
Copy link
Owner

stealth commented Feb 12, 2016

Correct. "-n 1" forces single core, even when multiple cores are detected. Omitting -n should start
4 sshttpd's on your pi, and only one sshttpd should run 100% if there is only a single
streaming connection. More connections should be distributed by kernel to the remaining
sshttpd's. If you dont see 4 sshttpd's, something got wrong with the core detection and you
could use "-n 4".

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

2 participants