Project

General

Profile

[Solved] High CPU usage

Added by Manuel J. Garcia Egido over 2 years ago

Hello.
I use HTS Tvheadend 4.3.2010~git20220320.3b1d7a928~ppa1~focal on a pc with Ubuntu 20.04 (Lubuntu. LXDE), Intel core2 Duo E8300 cpu and 8 Gb of ram. I use it to watch live TV both through a television connected directly to the PC and on another PC on the local network through VLC. I have been using this configuration for several years without any problem, but recently I have started to have a very annoying problem and that is that, for no apparent reason, when tvheadend is not working on playback, even though it is on, at some point it would not be able to determine its consumption cpu is very high, specifically one of the two cores is at 100%.
The problems started after the installation of minisatip, although they occur just the same using minisatip or when it is disabled and Tvhedend runs with the traditional configuration.
I have installed and uninstalled several times changing the Official, Mamarley, Nkvoronov distributions and in all of them exactly the same thing happens. I have to restart Tvheadend to get the cpu back to normal values.
Can anyone guide me on this problem?
Attached screenshot is HTOP output, I could use GDB if you tell me how to do it.
Thanks.

(Sorry for English-Google)


Replies (15)

RE: High CPU usage - Added by saen acro over 2 years ago

Set htop as this

result must be something as this

https://tvheadend.org/boards/4/topics/24116

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

Thank you Saen.
I have to wait for the error to occur. I don't know how to provoke it.

RE: High CPU usage - Added by saen acro over 2 years ago

Let me guess, you have one tuner and network with more then one frequency's,
and client's with want different frequency's in same time.

7 HD streams

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

hmmm! Is that what is happening? I don't understand how it can be. As I said, Tvheadend's clients are Kodi, from the pc connected to the tv, VLC from a pc on the local network and, occasionally, a mobile phone, through the browser, but the only claimant is me, that is, there are never 2 instances at the same time, I don't even think I asked for 7 consecutive broadcasts, although it could be that I did it trying to cause the error. Why could this be happening then?

I configure Tvheadend using a Github script that includes Mux, services and EPG, I have been using it for a long time without problems. I only have one user * admin configured. I doubt that someone is accessing my network. The only thing I can think of that could happen is that the requests are not canceled and are always active, although the problem occurs quite some time later, when I am not requesting anything from Tvheadend. Also, when the error is occurring, the Tvhedend webif shows no signs of activity.

RE: High CPU usage - Added by saen acro over 2 years ago

What show status and logs inside TVH WEB-UI

On user "*" can allow only access from you lan
ex:
if router ip is
192.168.1.1
allow access from
192.168.1.0/24

from outside make other user

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

Ok!
I just started Tvheadend and directly the error has started.
Tvheadend webif during the error:

htop during error:

Attached Sys.log from last start of Tvheadend.
P.S. I do not need to use Tvhedend from outside the local network, I understand that it is not necessary to create a new user.

syslog (144 KB) syslog

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

In the start of Tvheadend that I showed in the previous comment, "initial scan" was enabled, it is not usually like that, sorry if it may have caused confusion. After disabling it, I restarted Tvheadend and waited for the error to occur again. From then until the error occurred this is what the Sys.log recorded.
If I knew what the relevant information was, I would select it.

RE: High CPU usage - Added by saen acro over 2 years ago

Disable all unused EPG modules.

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

There is only one module enabled

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

Yesterday the problem never occurred, today it seemed that it was going the same way, I was beginning to think that it had been solved, but... it happened! I think if Syslog reflects it he should be on these lines, starting at 12:04:57 and until I restarted Tvheadend at 12:18:02.
Any idea what is happening in this interval?
Thanks.

syslog (4.52 KB) syslog

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

Is this difference in CPU consumption normal?

Tvheadend Player:

VLC:

RE: High CPU usage - Added by saen acro over 2 years ago

Disable external EPG and use internal NOW/NEXT.
Set extarnal EPG to be downloaded once on 24h.

RE: High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

Thank you saen.
That's where the conclusions I was coming to after yesterday didn't have that high CPU usage even once: Maybe, when switching from minisatip to traditional mode, "EPG over the air" was activated and being the disabled modules would cause the problem. When it happened again today, my approaches have been broken. Yes I am going to remove the EPG refresh for 3 times a day, it is unnecessary, I may leave it as default or even remove it completely to see if that solves the problem. I suspect that indeed it has something to do with the EPG. You too?

Edit:
I do not know. I have now put the retransmission of Fómula1 with VLC and the CPU has risen (I don't know if the EPG is involved in this). After restarting Tvheadend the CPU returns to a minimum consumption.

RE: [Solved] High CPU usage - Added by Manuel J. Garcia Egido over 2 years ago

Well, it seems that the problem has been solved: that high usage of the CPU has not occurred for days. The point is that, as is often the case in these cases and having made more than one change, I don't know exactly what has solved it.

Since I suspected that the problems came from the EPG, instead of installing it through a script that configures everything, I did a manual setup from scratch. I doubt that this was the solution, because with the script it had always worked correctly.

I think the problem was in the existence of 2 ".hts" folders; the one corresponding to my old installation in the address "/home/user folder/.hts" and the one that had been created with the updates in "/home/.hts". First I renamed the old one to ".hts.old" and then after a while I removed it and the problems disappeared, I understand that, for some unknown reason, both configurations interfered and generated the problem.

I would still like to know if the high CPU usage by Tvheadend player compared to VLC is normal.

Greetings and thanks for the help.

    (1-15/15)