nurdism / neko

A self hosted virtual browser (rabb.it clone) that runs in docker.
Apache License 2.0
2.03k stars 186 forks source link

[Question] Why is the entry binary itself zapping all that CPU? #110

Open IngwiePhoenix opened 3 years ago

IngwiePhoenix commented 3 years ago

For context, a snippet from htop:

  PID  PPID USER       VIRT   RES   SHR S CPU% MEM% Command
 9075  8976 nagios    2283M 46720  6064 S 95.9  0.6 /usr/bin/neko serve -d --static /var/www

(ignore "nagios" as the user - htop is being stupid. It matched the docker UID to a local UID...)

I just would like to know why it's zapping away sll of that CPU runtime? I mean, technically, it should only need to watch over a few processes - xorg, firefox-esr, ... - but yet it's needing all this CPU. Also - nobody is connected.

This is just a question of curiosity :)

GigaFyde commented 3 years ago

2 words: Software Encoding.

It has to encode the stream entirely in software, which takes up a chunk of cpu.

IngwiePhoenix commented 3 years ago

Ohh, I see. Thanks!

What would the efford be to add hardware accellerated rendering? It wouldn't make a difference on my server since it's an iGPU anyway, but I'd love to know ^^

GigaFyde commented 3 years ago

We've been exploring the possibilities, but haven't booked any results yet. We know it's possible, the road to get there is just unclear

IngwiePhoenix commented 3 years ago

Ahh, fair enough. Good luck on the journey of implementing it then! ^_^

m1k1o commented 3 years ago

@IngwiePhoenix This is actually a bug, because of outdated docker image, see https://github.com/nurdism/neko/issues/115#issuecomment-753350680.

GigaFyde commented 3 years ago

Heh, seems I missed the bit that said "Also - nobody is connected." at that time.